Nimbus
0.9.3 - Nimbus is proudly hosted on Github
An iOS framework whose growth is bounded by O(documentation).
|
A leight-weight DOM-like object to which you attach views and stylesheets.
To be clear: this is not an HTML DOM, but its intent is the same. NIDOM is designed to simplify the view <=> stylesheet relationship. Add a view to the DOM and it will automatically apply any applicable styles from the attached stylesheet. If the stylesheet changes you can refresh the DOM and all registered views will be updated accordingly.
NIDOM is most useful when you create a single NIDOM per view controller.
NIStylesheet* stylesheet = [stylesheetCache stylesheetWithPath:@"root/root.css"]; // Create a NIDOM object in your view controller. _dom = [[NIDOM alloc] initWithStylesheet:stylesheet];
You then register views in the DOM during loadView or viewDidLoad.
// Registers a view by itself such that only "UILabel" rulesets will apply. [_dom registerView:_label]; // Register a view with a specific CSS class. Any rulesets with the ".background" scope will // apply to this view. [_dom registerView:self.view withCSSClass:@"background"];
Once the view controller unloads its view you must unregister all of the views from your DOM.
- (void)viewDidUnload { [_dom unregisterAllViews]; }
Methods | |
Creating NIDOMs | |
(id) | - initWithStylesheet: |
(id) | + domWithStylesheet: |
(id) | + domWithStylesheetWithPathPrefix:paths: |
Registering Views | |
(void) | - registerView: |
(void) | - registerView:withCSSClass: |
(void) | - unregisterView: |
(void) | - unregisterAllViews |
Re-Applying All Styles | |
(void) | - refresh |
- (id) initWithStylesheet: | (NIStylesheet *) | stylesheet |
+ (id) domWithStylesheet: | (NIStylesheet *) | stylesheet |
- (void) registerView: | (UIView *) | view |
- (void) registerView: | (UIView *) | view | |
withCSSClass: | (NSString *) | cssClass | |
- (void) unregisterView: | (UIView *) | view |
- (void) unregisterAllViews |