Where a style ID, a style beginning with the tilde character, is defined in the theme JSON file, it must manually be applied to a View object. There are two ways to do this. The first is to call the method from the category UIView+ATGThemeAdditions.h, for example:

[myView applyStyleWithName:@”~myStyleId”]

The second way is a short-hand way of writing the first, with one important distinction: applying a style in this second way allows the UIView to store which style IDs have been applied to it. This means the View has the information it needs in order to update its styling. In practice, when the theme JSON is updated, the theme code can inform interested Views that the theme has changed. The Views can then ask ATGThemeManager to re-apply the style (because it has stored the previously applied style IDs) thus allowing the view to show the style updates. To apply a style in this way, simply call the applyStyleWithName:(NSString *) selector from within a view. applyStyleWithName is defined in a UIView category.


Copyright © 1997, 2013 Oracle and/or its affiliates. All rights reserved. Legal Notices