Skip to content

Commit

Permalink
Add support for the UIAppearance proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
mhupman committed Nov 25, 2013
1 parent 37c8fb5 commit b0ffb74
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 4 deletions.
9 changes: 9 additions & 0 deletions BlurryModalDemo/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,16 @@
//

#import "AppDelegate.h"
#import <BlurryModalSegue/BlurryModalSegue.h>

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[[BlurryModalSegue appearance] setBackingImageBlurRadius:@(20)];
[[BlurryModalSegue appearance] setBackingImageSaturationDeltaFactor:@(.45)];

return YES;
}

@end
1 change: 1 addition & 0 deletions BlurryModalSegue.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 5 additions & 3 deletions BlurryModalSegue/BlurryModalSegue.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 9 additions & 0 deletions BlurryModalSegue/BlurryModalSegue.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,26 @@
#import "BlurryModalSegue.h"
#import <QuartzCore/QuartzCore.h>
#import <UIImage+BlurredFrame/UIImage+ImageEffects.h>
#import <MZAppearance/MZAppearance.h>

@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;
Expand Down
5 changes: 4 additions & 1 deletion Podfile.lock
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -11,7 +13,8 @@ EXTERNAL SOURCES:
:path: .

SPEC CHECKSUMS:
BlurryModalSegue: 546886aa2e1fc6fba86033bec6d320aa1db21e56
BlurryModalSegue: 3d05de937fdf5bda8acb2863e5f149f4a364122b
MZAppearance: 8b02683f0019f725557ae9839ed6cab153fff669
UIImage+BlurredFrame: e35b3b542923b64e0ef1c5cfd2ef7971a9a0b2a3

COCOAPODS: 0.28.0

0 comments on commit b0ffb74

Please sign in to comment.