Native declarative styling facilities for UIKit components. AMUIStylis styles are essentially collections of selector invocations recorded over special proxy object, and easily applicable to any other compatible UIKit (actually Cocoa) object.
Forget about
someButton.backgroundColor = kGreenColor;
Use semantic style names
someButton.am_style = @"awesome-action-button";
[someButton setBackgroundColor:[UIColor greenColor]];
[someButton setTitleColor:[UIColor darkTextColor] forState:UIControlStateNormal];
[someButton setImage:[UIImage imageNamed:@"awesome-button"] forState:UIControlStateNormal];
...
someButton.am_style = @"awesome-action-button";
otherButton.am_style = @"awesome-action-button";
loginButton.am_style = @"awesome-action-button";
someButton.am_style = @"large-text, awesome-action-button";
NSMutableDictionary *dullDictStyle = style(NSMutableDictionary.self);
[dullDictStyle setObject:@YES forKey:@"Am I dull?"];
This will produce combined style from inputFieldStyle settings plus setSecureTextEntry
UITextField *passwordFieldStyle = style(UITextField.self, inputFieldStyle);
[passwordFieldStyle setSecureTextEntry:YES];
[AMUIStylist sharedStylist].styleSheet = [AMUIStyleSheet getSheet:@"swag"];
For more examples please take a look at included demo app and test cases.
To install dependencies:
cd Example
pod install
Open AMUIStylistExample.xcworkspace
with Xcode and hit Run.
Currently AMUIStylist depends on:
Unit tests require:
- Get rid of library dependencies.
- Create podspec.