Skip to content

Commit

Permalink
1.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
cezarywojcik committed Sep 22, 2013
1 parent f593f4f commit 11749f7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CWPopup.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "CWPopup"
s.version = "1.2.0"
s.version = "1.2.1"
s.summary = "A category on UIViewController to present a popup view controller."
s.description = "CWPopup adds a category on UIViewController to present a popup view controller. It offers an animated and non-animated presentation of the popup, similarly to presenting a modal controller or pushing a view controller."
s.homepage = "http://github.com/cezarywojcik/CWPopup"
Expand Down
9 changes: 8 additions & 1 deletion CWPopup/UIViewController+CWPopup.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ @interface UIImage (ImageBlur)
- (UIImage *)applyBlurWithRadius:(CGFloat)blurRadius tintColor:(UIColor *)tintColor saturationDeltaFactor:(CGFloat)saturationDeltaFactor maskImage:(UIImage *)maskImage;
@end

#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000
@implementation UIImage (ImageBlur)
// This method is taken from Apple's UIImageEffects category provided in WWDC 2013 sample code
- (UIImage *)applyBlurWithRadius:(CGFloat)blurRadius tintColor:(UIColor *)tintColor saturationDeltaFactor:(CGFloat)saturationDeltaFactor maskImage:(UIImage *)maskImage
Expand Down Expand Up @@ -148,6 +149,7 @@ - (UIImage *)applyBlurWithRadius:(CGFloat)blurRadius tintColor:(UIColor *)tintCo
return outputImage;
}
@end
#endif

#define ANIMATION_TIME 0.5f
#define STATUS_BAR_SIZE 22
Expand Down Expand Up @@ -357,7 +359,12 @@ - (UIViewController *)popupViewController {
}

- (void)setUseBlurForPopup:(BOOL)useBlurForPopup {
objc_setAssociatedObject(self, &CWUseBlurForPopup, [NSNumber numberWithBool:useBlurForPopup], OBJC_ASSOCIATION_RETAIN_NONATOMIC);
if ([[[UIDevice currentDevice] systemVersion] floatValue] < 7.0 && useBlurForPopup) {
NSLog(@"ERROR: Blur unavailable prior to iOS 7");
objc_setAssociatedObject(self, &CWUseBlurForPopup, [NSNumber numberWithBool:NO], OBJC_ASSOCIATION_RETAIN_NONATOMIC);
} else {
objc_setAssociatedObject(self, &CWUseBlurForPopup, [NSNumber numberWithBool:useBlurForPopup], OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}
}

- (BOOL)useBlurForPopup {
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ CWPopup is a category on UIViewController that allows you to easily make popup v

### [CocoaPods](http://www.cocoapods.org)

`pod 'CWPopup', '~> 1.2.0'`
`pod 'CWPopup', '~> 1.2.1'`

### Manual

Import the directory `CWPopup` into your project. It contains the UIViewController categories.

### Requirements

* Uses ARC
* ARC
* iOS 4.3

## Usage
Expand All @@ -34,6 +34,8 @@ You can choose to use either a fade background or a blurred background. The fade

self.useBlurForPopup = YES;

**NOTE:** Blur is only available in iOS 7+.

To present a view controller:

SamplePopupViewController *samplePopupViewController = [[SamplePopupViewController alloc] initWithNibName:@"SamplePopupViewController" bundle:nil];
Expand Down

0 comments on commit 11749f7

Please sign in to comment.