diff --git a/BlurryModalDemo/AppDelegate.m b/BlurryModalDemo/AppDelegate.m index 892c9e4..495a8ea 100644 --- a/BlurryModalDemo/AppDelegate.m +++ b/BlurryModalDemo/AppDelegate.m @@ -7,7 +7,16 @@ // #import "AppDelegate.h" +#import @implementation AppDelegate +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + [[BlurryModalSegue appearance] setBackingImageBlurRadius:@(20)]; + [[BlurryModalSegue appearance] setBackingImageSaturationDeltaFactor:@(.45)]; + + return YES; +} + @end diff --git a/BlurryModalSegue.podspec b/BlurryModalSegue.podspec index 77ee101..17c71b7 100644 --- a/BlurryModalSegue.podspec +++ b/BlurryModalSegue.podspec @@ -18,5 +18,6 @@ Pod::Spec.new do |s| s.framework = 'QuartzCore' s.requires_arc = true s.dependency 'UIImage+BlurredFrame', '~> 0.0.2' + s.dependency 'MZAppearance', '~>1.1.1' end diff --git a/BlurryModalSegue/BlurryModalSegue.h b/BlurryModalSegue/BlurryModalSegue.h index 8f82e23..be1d7f1 100644 --- a/BlurryModalSegue/BlurryModalSegue.h +++ b/BlurryModalSegue/BlurryModalSegue.h @@ -16,8 +16,10 @@ typedef UIImage*(^ProcessBackgroundImage)(BlurryModalSegue* blurryModalSegue, UI @property (nonatomic, copy) ProcessBackgroundImage processBackgroundImage; -@property (nonatomic) NSNumber* backingImageBlurRadius; -@property (nonatomic) NSNumber* backingImageSaturationDeltaFactor; -@property (nonatomic) UIColor* backingImageTintColor; +@property (nonatomic) NSNumber* backingImageBlurRadius UI_APPEARANCE_SELECTOR; +@property (nonatomic) NSNumber* backingImageSaturationDeltaFactor UI_APPEARANCE_SELECTOR; +@property (nonatomic) UIColor* backingImageTintColor UI_APPEARANCE_SELECTOR; + ++ (id)appearance; @end diff --git a/BlurryModalSegue/BlurryModalSegue.m b/BlurryModalSegue/BlurryModalSegue.m index 36df4a0..0f2a536 100644 --- a/BlurryModalSegue/BlurryModalSegue.m +++ b/BlurryModalSegue/BlurryModalSegue.m @@ -9,17 +9,26 @@ #import "BlurryModalSegue.h" #import #import +#import @implementation BlurryModalSegue ++ (id)appearance +{ + return [MZAppearance appearanceForClass:[self class]]; +} + - (id)initWithIdentifier:(NSString *)identifier source:(UIViewController *)source destination:(UIViewController *)destination { self = [super initWithIdentifier:identifier source:source destination:destination]; if (self) { + // Some sane defaults self.backingImageBlurRadius = @(20); self.backingImageSaturationDeltaFactor = @(.45f); + + [[[self class] appearance] applyInvocationTo:self]; } return self; diff --git a/Podfile.lock b/Podfile.lock index 93b6c51..bf47484 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -1,6 +1,8 @@ PODS: - BlurryModalSegue (0.2.0): + - MZAppearance (~> 1.1.1) - UIImage+BlurredFrame (~> 0.0.2) + - MZAppearance (1.1.1) - UIImage+BlurredFrame (0.0.2) DEPENDENCIES: @@ -11,7 +13,8 @@ EXTERNAL SOURCES: :path: . SPEC CHECKSUMS: - BlurryModalSegue: 546886aa2e1fc6fba86033bec6d320aa1db21e56 + BlurryModalSegue: 3d05de937fdf5bda8acb2863e5f149f4a364122b + MZAppearance: 8b02683f0019f725557ae9839ed6cab153fff669 UIImage+BlurredFrame: e35b3b542923b64e0ef1c5cfd2ef7971a9a0b2a3 COCOAPODS: 0.28.0