mza

MZAppearance

UIAppearance proxy for custom objects

Showing:

Popularity

Downloads/wk

0

GitHub Stars

110

Maintenance

Last Commit

2yrs ago

Contributors

8

Package

Dependencies

0

License

MIT

Categories

Readme

Carthage compatible

MZAppearance

UIAppearance proxy for custom objects

How To Use

All you need is mark a method that participates in the appearance proxy API using MZ_APPEARANCE_SELECTOR. Implement protocol method + (id)appearance, and call applyInvocationTo inside your init or viewDidLoad object method.

@interface MZViewController : UIViewController <MZApperance>

@property (nonatomic,strong) UIColor *customColor MZ_APPEARANCE_SELECTOR;
@property (nonatomic,assign) CGFloat customFloat MZ_APPEARANCE_SELECTOR;

+ (id)appearance;

@end
+ (id)appearance
{
    return [MZAppearance appearanceForClass:[self class]];
}

- (void)viewDidLoad
{
    [super viewDidLoad];

    [[[self class] appearance] applyInvocationTo:self];
    
    NSLog(@"custom color: %@",self.customColor);
    NSLog(@"custom float: %f",self.customFloat);
}

How to setup appearance variable

[[MZViewController appearance] setCustomColor:[UIColor blackColor]];
[[MZViewController appearance] setCustomFloat:6.0];

Console result will be

2013-08-17 19:59:38.546 MZAppearance[3374:c07] custom color: UIDeviceWhiteColorSpace 0 1
2013-08-17 19:59:38.547 MZAppearance[3374:c07] custom float: 6.000000

Bitdeli Badge

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100