Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Getter for variables #1

popcorno opened this Issue · 1 comment

2 participants


// I want to be able to get the value of variables.

// Create json file.
"Variables": {
"defaultBackgroundColor": "red"

"@Controllers": {
    "MyViewController": {
        "UITableView": {
            "backgroundColor": "$defaultBackgroundColor"


// UISS init. And appearance is work.
UISS *uiss = [UISS configureWithDefaultJSONFile];
[UISS setSharedUISS:uiss];

// But sometimes I need write code
@implementation MyView

  • (void)drawRect:(CGRect)rect {
    UIColor *color = [[UISS sharedUISS] colorForVariable:@"defaultBackgroundColor"];

    UIBezierPath* bezier = [UIBezierPath bezierPath];
    // ... my bezier code
    [color setFill];
    [bezier fill];


// Other UISS methods

  • (id)valueForVariable:(NSString *)name;
  • (UIColor *)colorForVariable:(NSString *)name;
  • (UIFont *)fontForVariable:(NSString *)name;
  • (UIImage *)imageForVariable:(NSString *)name;

You can achieve this by adding UIAppearance property to your class.
Here is an example:

@robertwijas robertwijas was assigned
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.