Appearance for class when contained in container class

suggest change

Use appearanceWhenContainedInInstancesOfClasses: to customize a class only when an instance is contained in another class. For example, setting a UILabel’s textColor and backgroundColor when it is inside ViewController looks like this:

Set UILabel text color

Swift:

UILabel.appearanceWhenContainedInInstancesOfClasses([ViewController.self]).textColor = UIColor.whiteColor()

Objective-C:

[UILabel appearanceWhenContainedInInstancesOfClasses:@[[ViewController class]]].textColor = [UIColor whiteColor];

Set UILabel background color

Swift:

UILabel.appearanceWhenContainedInInstancesOfClasses([ViewController.self]).backgroundColor = UIColor.blueColor()

Objective-C:

[UILabel appearanceWhenContainedInInstancesOfClasses:@[[ViewController class]]].backgroundColor = [UIColor blueColor];

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents