From d6ddeb57cd555e190113a4ed2aa9f1f873559926 Mon Sep 17 00:00:00 2001 From: Alex Rouse Date: Thu, 27 Nov 2014 11:11:36 -0500 Subject: [PATCH 1/9] Lots of cleanup and comments --- .../RZTransitions-Demo-Prefix.pch | 10 ----- .../RZSimpleCollectionViewController.m | 1 + .../ViewControllers/RZSimpleViewController.m | 3 ++ .../RZAnimationControllerProtocol.h | 5 ++- .../RZCardSlideAnimationController.h | 25 +++++++++-- .../RZCardSlideAnimationController.m | 26 +++++------- .../RZCirclePushAnimationController.h | 36 +++++++++++----- .../RZCirclePushAnimationController.m | 35 +++++++--------- .../RZRectZoomAnimationController.h | 42 +++++++++++++++---- .../RZRectZoomAnimationController.m | 27 ++++++------ ...egmentControlMoveFadeAnimationController.m | 10 ++--- .../RZShrinkZoomAnimationController.m | 1 + .../RZTransitionsAnimationControllers.h | 5 +++ .../RZZoomAlphaAnimationController.m | 15 ++++--- .../RZZoomBlurAnimationController.h | 27 ++++++++++-- .../RZZoomBlurAnimationController.m | 26 +++--------- 16 files changed, 174 insertions(+), 120 deletions(-) diff --git a/RZTransitions-Demo/RZTransitions-Demo/RZTransitions-Demo-Prefix.pch b/RZTransitions-Demo/RZTransitions-Demo/RZTransitions-Demo-Prefix.pch index 82a2bb4..fbe8d11 100644 --- a/RZTransitions-Demo/RZTransitions-Demo/RZTransitions-Demo-Prefix.pch +++ b/RZTransitions-Demo/RZTransitions-Demo/RZTransitions-Demo-Prefix.pch @@ -4,13 +4,3 @@ // The contents of this file are implicitly included at the beginning of every source file. // -#import - -#ifndef __IPHONE_5_0 -#warning "This project uses features only available in iOS SDK 5.0 and later." -#endif - -#ifdef __OBJC__ - #import - #import -#endif diff --git a/RZTransitions-Demo/RZTransitions-Demo/ViewControllers/RZSimpleCollectionViewController.m b/RZTransitions-Demo/RZTransitions-Demo/ViewControllers/RZSimpleCollectionViewController.m index 3e8a23e..f58ca0f 100644 --- a/RZTransitions-Demo/RZTransitions-Demo/ViewControllers/RZSimpleCollectionViewController.m +++ b/RZTransitions-Demo/RZTransitions-Demo/ViewControllers/RZSimpleCollectionViewController.m @@ -84,6 +84,7 @@ - (void)viewDidLoad - (void)viewDidAppear:(BOOL)animated { + [super viewDidAppear:animated]; // TODO: ** Cannot set the scroll view delegate and the collection view delegate at the same time ** // [self.presentOverscrollInteractor watchScrollView:self.collectionView]; } diff --git a/RZTransitions-Demo/RZTransitions-Demo/ViewControllers/RZSimpleViewController.m b/RZTransitions-Demo/RZTransitions-Demo/ViewControllers/RZSimpleViewController.m index 2f4da66..be22019 100644 --- a/RZTransitions-Demo/RZTransitions-Demo/ViewControllers/RZSimpleViewController.m +++ b/RZTransitions-Demo/RZTransitions-Demo/ViewControllers/RZSimpleViewController.m @@ -51,6 +51,8 @@ @implementation RZSimpleViewController - (void)viewDidLoad { + [super viewDidLoad]; + // Create the push and pop interaction controller that allows a custom gesture // to control pushing and popping from the navigation controller self.pushPopInteractionController = [[RZHorizontalInteractionController alloc] init]; @@ -86,6 +88,7 @@ - (void)viewDidLoad - (void)viewWillAppear:(BOOL)animated { + [super viewWillAppear:animated]; [[RZTransitionsManager shared] setInteractionController:self.presentInteractionController fromViewController:[self class] toViewController:nil diff --git a/RZTransitions/Transitions/RZAnimationControllerProtocol.h b/RZTransitions/Transitions/RZAnimationControllerProtocol.h index f99ee01..5e39720 100644 --- a/RZTransitions/Transitions/RZAnimationControllerProtocol.h +++ b/RZTransitions/Transitions/RZAnimationControllerProtocol.h @@ -35,8 +35,9 @@ /** * If the animation should be positive or negative. - * Positive: push / present / fromTop / toRight - * Negative: pop / dismiss / fromBottom / toLeft + * + * @note Positive: push / present / fromTop / toRight + * @note Negative: pop / dismiss / fromBottom / toLeft */ @property (nonatomic, assign) BOOL isPositiveAnimation; diff --git a/RZTransitions/Transitions/RZCardSlideAnimationController.h b/RZTransitions/Transitions/RZCardSlideAnimationController.h index 419d7ef..13960c9 100644 --- a/RZTransitions/Transitions/RZCardSlideAnimationController.h +++ b/RZTransitions/Transitions/RZCardSlideAnimationController.h @@ -27,12 +27,31 @@ // #import +#import + #import "RZAnimationControllerProtocol.h" @interface RZCardSlideAnimationController : NSObject -@property (nonatomic, assign) CGFloat transitionTime; -@property (nonatomic, assign) BOOL horizontalOrientation; -@property (nonatomic, strong) UIColor *containerBackgroundColor; +/** + * The duration of the transition. + * + * Default transition time is 0.35 seconds + */ +@property (assign, nonatomic) NSTimeInterval transitionTime; + +/** + * flag to set if it is going in the horiztonal orientation as opposed to vertical. + * + * Defaults to YES + */ +@property (assign, nonatomic) BOOL horizontalOrientation; + +/** + * The background color for the transitions container. + * + * Default is [UIColor blackColor] + */ +@property (strong, nonatomic) UIColor *containerBackgroundColor; @end diff --git a/RZTransitions/Transitions/RZCardSlideAnimationController.m b/RZTransitions/Transitions/RZCardSlideAnimationController.m index 4c96b39..de93247 100644 --- a/RZTransitions/Transitions/RZCardSlideAnimationController.m +++ b/RZTransitions/Transitions/RZCardSlideAnimationController.m @@ -35,13 +35,12 @@ @implementation RZCardSlideAnimationController @synthesize isPositiveAnimation = _isPositiveAnimation; -- (id)init +- (instancetype)init { self = [super init]; - if (self) - { + if ( self ) { _transitionTime = kRZSlideTransitionTime; - _horizontalOrientation = TRUE; + _horizontalOrientation = YES; _containerBackgroundColor = [UIColor blackColor]; } return self; @@ -58,8 +57,7 @@ - (void)animateTransition:(id)transitionCo bgView.backgroundColor = self.containerBackgroundColor; [container insertSubview:bgView atIndex:0]; - if (self.isPositiveAnimation) - { + if ( self.isPositiveAnimation ) { [container insertSubview:toViewController.view belowSubview:fromViewController.view]; toViewController.view.transform = CGAffineTransformMakeScale(1.0 - kRZSlideScaleChangePct, 1.0 - kRZSlideScaleChangePct); toViewController.view.alpha = 0.1f; @@ -70,12 +68,10 @@ - (void)animateTransition:(id)transitionCo animations:^{ toViewController.view.transform = CGAffineTransformIdentity; toViewController.view.alpha = 1.0f; - if (self.horizontalOrientation) - { + if ( self.horizontalOrientation ) { fromViewController.view.transform = CGAffineTransformMakeTranslation(-container.bounds.size.width, 0); } - else - { + else { fromViewController.view.transform = CGAffineTransformMakeTranslation(0, container.bounds.size.height); } } @@ -86,15 +82,13 @@ - (void)animateTransition:(id)transitionCo [transitionContext completeTransition:!transitionContext.transitionWasCancelled]; }]; } - else - { + else { [container addSubview:toViewController.view]; - if (self.horizontalOrientation) - { + + if ( self.horizontalOrientation ) { toViewController.view.transform = CGAffineTransformMakeTranslation(-container.bounds.size.width, 0); } - else - { + else { toViewController.view.transform = CGAffineTransformMakeTranslation(0, container.bounds.size.height); } diff --git a/RZTransitions/Transitions/RZCirclePushAnimationController.h b/RZTransitions/Transitions/RZCirclePushAnimationController.h index 564a01c..35f4f9b 100644 --- a/RZTransitions/Transitions/RZCirclePushAnimationController.h +++ b/RZTransitions/Transitions/RZCirclePushAnimationController.h @@ -27,8 +27,33 @@ // #import +#import + #import "RZZoomPushAnimationController.h" +@protocol RZCirclePushAnimationDelegate; + +@interface RZCirclePushAnimationController : RZZoomPushAnimationController + +/** + * Animation delegate for controlling information about the circle transition. + */ +@property (weak, nonatomic) id circleDelegate; + +/** + * The maximum scale that a circle will get to during the transition. Used in as a transform.scale. + * Default is 2.5. + */ +@property (assign, nonatomic) CGFloat maximumCircleScale; + +/** + * The minimum scale that a circle will get to during the transition. Used in as a transform.scale. + * Default is 0.25. + */ +@property (assign, nonatomic) CGFloat minimumCircleScale; + +@end + @protocol RZCirclePushAnimationDelegate @optional @@ -47,13 +72,4 @@ */ - (CGFloat)circleStartingRadius; -@end - -@interface RZCirclePushAnimationController : RZZoomPushAnimationController - - -@property (nonatomic, weak) id circleDelegate; -@property (nonatomic, assign) CGFloat maximumCircleScale; -@property (nonatomic, assign) CGFloat minimumCircleScale; - -@end +@end \ No newline at end of file diff --git a/RZTransitions/Transitions/RZCirclePushAnimationController.m b/RZTransitions/Transitions/RZCirclePushAnimationController.m index f8bbec3..3711139 100644 --- a/RZTransitions/Transitions/RZCirclePushAnimationController.m +++ b/RZTransitions/Transitions/RZCirclePushAnimationController.m @@ -27,6 +27,7 @@ // #import "RZCirclePushAnimationController.h" +#import #define kRZCircleDefaultMaxScale 2.5f #define kRZCircleDefaultMinScale 0.25f @@ -47,10 +48,10 @@ @implementation RZCirclePushAnimationController #pragma mark - Animation Transition -- (id)init +- (instancetype)init { self = [super init]; - if (self) { + if ( self ) { _minimumCircleScale = kRZCircleDefaultMinScale; _maximumCircleScale = kRZCircleDefaultMaxScale; } @@ -84,29 +85,27 @@ - (void)animateTransition:(id)transitionCo // Set manual easing on the animation. Tweak for fun! [circleMaskAnimation setTimingFunction:[CAMediaTimingFunction functionWithControlPoints:.34 :.01 :.69 :1.37]]; - if (self.isPositiveAnimation) - { + if ( self.isPositiveAnimation ) { [circleMaskAnimation setFillMode:kCAFillModeForwards]; // Animate from small to large - circleMaskAnimation.fromValue = [NSNumber numberWithFloat:self.minimumCircleScale]; - circleMaskAnimation.toValue = [NSNumber numberWithFloat:self.maximumCircleScale]; + circleMaskAnimation.fromValue = @(self.minimumCircleScale); + circleMaskAnimation.toValue = @(self.maximumCircleScale); // Add to the view and start the animation - [toViewController.view.layer setMask:circleMaskLayer]; + toViewController.view.layer.mask = circleMaskLayer; toViewController.view.layer.masksToBounds = YES; [circleMaskLayer addAnimation:circleMaskAnimation forKey:kRZCircleMaskAnimation]; } - else - { + else { [circleMaskAnimation setFillMode:kCAFillModeForwards]; // Animate from large to small - circleMaskAnimation.fromValue = [NSNumber numberWithFloat:1.0f]; - circleMaskAnimation.toValue = [NSNumber numberWithFloat:self.minimumCircleScale]; + circleMaskAnimation.fromValue = @(1.0f); + circleMaskAnimation.toValue = @(self.minimumCircleScale); // Add to the view and start the animation - [fromViewController.view.layer setMask:circleMaskLayer]; + fromViewController.view.layer.mask = circleMaskLayer; fromViewController.view.layer.masksToBounds = YES; [circleMaskLayer addAnimation:circleMaskAnimation forKey:kRZCircleMaskAnimation]; } @@ -120,12 +119,10 @@ - (void)animateTransition:(id)transitionCo - (CGPoint)circleCenterPointWithFromViewController:(UIViewController *)fromViewController { CGPoint center = CGPointZero; - if (self.circleDelegate && [self.circleDelegate respondsToSelector:@selector(circleCenter)]) - { + if ( self.circleDelegate && [self.circleDelegate respondsToSelector:@selector(circleCenter)] ) { center = [self.circleDelegate circleCenter]; } - else - { + else { center = CGPointMake(fromViewController.view.bounds.origin.x + fromViewController.view.bounds.size.width / 2, fromViewController.view.bounds.origin.y + fromViewController.view.bounds.size.height / 2); } @@ -137,14 +134,12 @@ - (CGFloat)circleStartingRadiusWithFromViewController:(UIViewController *)fromVi withToViewController:(UIViewController *)toViewController { CGFloat radius = 0.0f; - if (self.circleDelegate && [self.circleDelegate respondsToSelector:@selector(circleStartingRadius)]) - { + if ( self.circleDelegate && [self.circleDelegate respondsToSelector:@selector(circleStartingRadius)] ) { radius = [self.circleDelegate circleStartingRadius]; CGRect bounds = toViewController.view.bounds; self.maximumCircleScale = ((MAX(bounds.size.height, bounds.size.width) / (radius)) * 1.25); } - else - { + else { CGRect bounds = fromViewController.view.bounds; CGFloat diameter = MIN(bounds.size.height, bounds.size.width); radius = diameter / 2; diff --git a/RZTransitions/Transitions/RZRectZoomAnimationController.h b/RZTransitions/Transitions/RZRectZoomAnimationController.h index 8d14bac..943d3eb 100644 --- a/RZTransitions/Transitions/RZRectZoomAnimationController.h +++ b/RZTransitions/Transitions/RZRectZoomAnimationController.h @@ -27,20 +27,46 @@ // #import +#import + #import "RZAnimationControllerProtocol.h" -@protocol RZRectZoomAnimationDelegate +@protocol RZRectZoomAnimationDelegate; -// Return the rect to insert the next view into. This should be relative to the view controller's view. -- (CGRect)rectZoomPosition; +@interface RZRectZoomAnimationController : NSObject + +/** + * The delegate for information about the positioning of the views. + */ +@property (weak, nonatomic) id rectZoomDelegate; + +/** + * Flag to allow the From View controller to fade it's alpha. + * Default to YES; + */ +@property (assign, nonatomic) BOOL shouldFadeBackgroundViewController; + +/** + * Physics animation spring dampening. + * Default is 0.6f. + */ +@property (assign, nonatomic) CGFloat animationSpringDampening; + +/** + * Physics animation spring velocity. + * Default is 15.0f. + */ +@property (assign, nonatomic) CGFloat animationSpringVelocity; @end -@interface RZRectZoomAnimationController : NSObject +@protocol RZRectZoomAnimationDelegate -@property (nonatomic, weak) id rectZoomDelegate; -@property (nonatomic, assign) BOOL shouldFadeBackgroundViewController; -@property (nonatomic, assign) CGFloat animationSpringDampening; -@property (nonatomic, assign) CGFloat animationSpringVelocity; +/** + * The rect that the ToView will go to. This should be relative to the view controller. + * + * @return The rect to insert the ToView into. + */ +- (CGRect)rectZoomPosition; @end diff --git a/RZTransitions/Transitions/RZRectZoomAnimationController.m b/RZTransitions/Transitions/RZRectZoomAnimationController.m index 9871844..c24973f 100644 --- a/RZTransitions/Transitions/RZRectZoomAnimationController.m +++ b/RZTransitions/Transitions/RZRectZoomAnimationController.m @@ -27,15 +27,13 @@ // #import "RZRectZoomAnimationController.h" +#import static const CGFloat kRZRectZoomAnimationTime = 0.7f; static const CGFloat kRZRectZoomDefaultFadeAnimationTime = 0.2f; static const CGFloat kRZRectZoomDefaultSpringDampening = 0.6f; static const CGFloat kRZRectZoomDefaultSpringVelocity = 15.0f; -@interface RZRectZoomAnimationController () - -@end @implementation RZRectZoomAnimationController @@ -43,10 +41,10 @@ @implementation RZRectZoomAnimationController #pragma mark - Animation Transition -- (id)init +- (instancetype)init { self = [super init]; - if (self) { + if ( self ) { _shouldFadeBackgroundViewController = YES; _animationSpringDampening = kRZRectZoomDefaultSpringDampening; _animationSpringVelocity = kRZRectZoomDefaultSpringVelocity; @@ -60,9 +58,10 @@ - (void)animateTransition:(id)transitionCo UIViewController *toViewController = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey]; UIView *container = [transitionContext containerView]; - __block CGRect originalFrame = toViewController.view.frame; - __block CGRect cellFrame = CGRectZero; - if ( (self.rectZoomDelegate != nil) && [self.rectZoomDelegate respondsToSelector:@selector(rectZoomPosition)] ) { + CGRect originalFrame = toViewController.view.frame; + CGRect cellFrame = CGRectZero; + + if ( [self.rectZoomDelegate respondsToSelector:@selector(rectZoomPosition)] ) { cellFrame = [self.rectZoomDelegate rectZoomPosition]; } @@ -72,7 +71,7 @@ - (void)animateTransition:(id)transitionCo [container addSubview:resizableSnapshotView]; [UIView animateWithDuration:kRZRectZoomDefaultFadeAnimationTime animations:^{ - if (self.shouldFadeBackgroundViewController) { + if ( self.shouldFadeBackgroundViewController ) { fromViewController.view.alpha = 0.0f; } }]; @@ -87,10 +86,10 @@ - (void)animateTransition:(id)transitionCo } completion:^(BOOL finished) { [container addSubview:toViewController.view]; [resizableSnapshotView removeFromSuperview]; - if (self.shouldFadeBackgroundViewController) { - fromViewController.view.alpha = 1.0f; - } - [transitionContext completeTransition:!transitionContext.transitionWasCancelled]; + if ( self.shouldFadeBackgroundViewController ) { + fromViewController.view.alpha = 1.0f; + } + [transitionContext completeTransition:!transitionContext.transitionWasCancelled]; }]; } else { @@ -101,6 +100,8 @@ - (void)animateTransition:(id)transitionCo [container insertSubview:toViewController.view belowSubview:resizableSnapshotView]; toViewController.view.alpha = 0.0f; + + //! TODO: no... We need to fix this. Figure out who needed this line, do it right, then test. [toViewController viewWillAppear:YES]; [UIView animateWithDuration:kRZRectZoomDefaultFadeAnimationTime animations:^{ diff --git a/RZTransitions/Transitions/RZSegmentControlMoveFadeAnimationController.m b/RZTransitions/Transitions/RZSegmentControlMoveFadeAnimationController.m index 14ddecc..75e46fe 100644 --- a/RZTransitions/Transitions/RZSegmentControlMoveFadeAnimationController.m +++ b/RZTransitions/Transitions/RZSegmentControlMoveFadeAnimationController.m @@ -27,6 +27,8 @@ // #import "RZSegmentControlMoveFadeAnimationController.h" +#import + #import "UIImage+RZTransitionsFastImageBlur.h" #define kRZSegAnimationTransitionTime 0.4f @@ -49,14 +51,11 @@ - (void)animateTransition:(id)transitionCo CGAffineTransform newTranslateTransform; // Animate to the right - if (self.isPositiveAnimation) - { + if ( self.isPositiveAnimation ) { oldTranslateTransform = CGAffineTransformMakeTranslation(container.bounds.size.width*kRZSegXOffsetFactor, -container.bounds.size.height*kRZSegYOffsetFactor); newTranslateTransform = CGAffineTransformMakeTranslation(-container.bounds.size.width*kRZSegXOffsetFactor, -container.bounds.size.height*kRZSegYOffsetFactor); } - // Animate to the left - else - { + else { // Animate to the left oldTranslateTransform = CGAffineTransformMakeTranslation(-container.bounds.size.width*kRZSegXOffsetFactor, -container.bounds.size.height*kRZSegYOffsetFactor); newTranslateTransform = CGAffineTransformMakeTranslation(container.bounds.size.width*kRZSegXOffsetFactor, -container.bounds.size.height*kRZSegYOffsetFactor); } @@ -84,5 +83,4 @@ - (NSTimeInterval)transitionDuration:(id)t return kRZSegAnimationTransitionTime; } - @end diff --git a/RZTransitions/Transitions/RZShrinkZoomAnimationController.m b/RZTransitions/Transitions/RZShrinkZoomAnimationController.m index 855d258..ba2939a 100644 --- a/RZTransitions/Transitions/RZShrinkZoomAnimationController.m +++ b/RZTransitions/Transitions/RZShrinkZoomAnimationController.m @@ -27,6 +27,7 @@ // #import "RZShrinkZoomAnimationController.h" +#import @implementation RZShrinkZoomAnimationController diff --git a/RZTransitions/Transitions/RZTransitionsAnimationControllers.h b/RZTransitions/Transitions/RZTransitionsAnimationControllers.h index 6d126ab..d10031c 100644 --- a/RZTransitions/Transitions/RZTransitionsAnimationControllers.h +++ b/RZTransitions/Transitions/RZTransitionsAnimationControllers.h @@ -29,6 +29,11 @@ #ifndef RZTransitions_Demo_RZTransitionsAnimationControllers_h #define RZTransitions_Demo_RZTransitionsAnimationControllers_h +/** + * This is general import helper. Saves importing multiple transitions. + * TODO: Why?/ Delete for next larger release. + */ + #import "RZCardSlideAnimationController.h" #import "RZCirclePushAnimationController.h" #import "RZSegmentControlMoveFadeAnimationController.h" diff --git a/RZTransitions/Transitions/RZZoomAlphaAnimationController.m b/RZTransitions/Transitions/RZZoomAlphaAnimationController.m index 6d9d455..ac04de0 100644 --- a/RZTransitions/Transitions/RZZoomAlphaAnimationController.m +++ b/RZTransitions/Transitions/RZZoomAlphaAnimationController.m @@ -27,6 +27,7 @@ // #import "RZZoomAlphaAnimationController.h" +#import #define kRZZoomAlphaTransitionTime 0.3 #define kRZZoomAlphaMaxScale 1.333 @@ -45,8 +46,7 @@ - (void)animateTransition:(id)transitionCo toViewController.view.userInteractionEnabled = YES; - if (!self.isPositiveAnimation) - { + if ( !self.isPositiveAnimation ) { fromViewController.view.opaque = NO; [container insertSubview:toViewController.view belowSubview:fromViewController.view]; @@ -54,19 +54,18 @@ - (void)animateTransition:(id)transitionCo delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^{ - fromViewController.view.alpha = 0.f; + fromViewController.view.alpha = 0.0f; fromViewController.view.transform = CGAffineTransformMakeScale(kRZZoomAlphaMaxScale, kRZZoomAlphaMaxScale); } completion:^(BOOL finished) { - fromViewController.view.alpha = 1.f; + fromViewController.view.alpha = 1.0f; fromViewController.view.transform = CGAffineTransformIdentity; [transitionContext completeTransition:!transitionContext.transitionWasCancelled]; }]; } - else - { + else { toViewController.view.opaque = NO; - toViewController.view.alpha = 0.f; + toViewController.view.alpha = 0.0f; toViewController.view.transform = CGAffineTransformMakeScale(kRZZoomAlphaMaxScale, kRZZoomAlphaMaxScale); [container addSubview:toViewController.view]; @@ -74,7 +73,7 @@ - (void)animateTransition:(id)transitionCo delay:0 options:UIViewAnimationOptionCurveEaseIn animations:^{ - toViewController.view.alpha = 1.f; + toViewController.view.alpha = 1.0f; toViewController.view.transform = CGAffineTransformIdentity; } completion:^(BOOL finished) { diff --git a/RZTransitions/Transitions/RZZoomBlurAnimationController.h b/RZTransitions/Transitions/RZZoomBlurAnimationController.h index b3ad053..79a3d55 100644 --- a/RZTransitions/Transitions/RZZoomBlurAnimationController.h +++ b/RZTransitions/Transitions/RZZoomBlurAnimationController.h @@ -27,14 +27,35 @@ // #import +#import +#import + #import "RZAnimationControllerProtocol.h" @interface RZZoomBlurAnimationController : NSObject -@property (nonatomic, assign) CGFloat blurRadius; +/** + * The blur radius used when snapshotting to the fromView and applying a blur to it. + * see UIImage+RZTransitionsFastImageBlur for more info. + * + * Default is 12.0f + */ +@property (assign, nonatomic) CGFloat blurRadius; -@property (nonatomic, assign) CGFloat saturationDelta; +/** + * The saturation amount used when applying the blur to the snapshot. + * see UIImage+RZTransitionsFastImageBlur for more info. + * + * Default is 1.0f + */ +@property (assign, nonatomic) CGFloat saturationDelta; -@property (nonatomic, strong) UIColor* blurTintColor; +/** + * The tint color that is used when applying the blur to the snapshot. + * see UIImage+RZTransitionsFastImageBlur for more info. + * + * Default is [UIColor colorWithWhite:1.0f alpha:0.15f] + */ +@property (strong, nonatomic) UIColor* blurTintColor; @end diff --git a/RZTransitions/Transitions/RZZoomBlurAnimationController.m b/RZTransitions/Transitions/RZZoomBlurAnimationController.m index a0bbfd7..0cd3832 100644 --- a/RZTransitions/Transitions/RZZoomBlurAnimationController.m +++ b/RZTransitions/Transitions/RZZoomBlurAnimationController.m @@ -36,37 +36,21 @@ #define kRZZBDefaultBlurRadius 12.0f #define kRZZBDefaultSaturationDelta 1.0f #define kRZZBDefaultTintColor [UIColor colorWithWhite:1.0f alpha:0.15f] + static char kRZZoomBlurImageAssocKey; @implementation RZZoomBlurAnimationController @synthesize isPositiveAnimation = _isPositiveAnimation; -- (CGFloat)blurRadius -{ - if (_blurRadius == 0) - { +- (instancetype)init { + self = [super init]; + if ( self ) { _blurRadius = kRZZBDefaultBlurRadius; - } - return _blurRadius; -} - -- (CGFloat)saturationDelta -{ - if (_saturationDelta == 0) - { _saturationDelta = kRZZBDefaultSaturationDelta; - } - return _saturationDelta; -} - -- (UIColor *)blurTintColor -{ - if (!_blurTintColor) - { _blurTintColor = kRZZBDefaultTintColor; } - return _blurTintColor; + return self; } #pragma mark - Animated transitioning From 66b03eea98380a6f1ce92ca6337b6d2114af4540 Mon Sep 17 00:00:00 2001 From: Alex Rouse Date: Thu, 27 Nov 2014 11:18:10 -0500 Subject: [PATCH 2/9] Adding a bit mroe cleanup comments --- .../Transitions/RZAnimationControllerProtocol.h | 2 ++ .../Transitions/RZZoomBlurAnimationController.m | 9 +++------ .../Transitions/RZZoomPushAnimationController.m | 11 +++++------ 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/RZTransitions/Transitions/RZAnimationControllerProtocol.h b/RZTransitions/Transitions/RZAnimationControllerProtocol.h index 5e39720..eaa5c5f 100644 --- a/RZTransitions/Transitions/RZAnimationControllerProtocol.h +++ b/RZTransitions/Transitions/RZAnimationControllerProtocol.h @@ -29,6 +29,8 @@ #ifndef RZTransitions_RZAnimationControllerProtocol_h #define RZTransitions_RZAnimationControllerProtocol_h +#import + @protocol RZAnimationControllerProtocol @required diff --git a/RZTransitions/Transitions/RZZoomBlurAnimationController.m b/RZTransitions/Transitions/RZZoomBlurAnimationController.m index 0cd3832..05936f1 100644 --- a/RZTransitions/Transitions/RZZoomBlurAnimationController.m +++ b/RZTransitions/Transitions/RZZoomBlurAnimationController.m @@ -63,8 +63,7 @@ - (void)animateTransition:(id)transitionCo toViewController.view.userInteractionEnabled = YES; - if (!self.isPositiveAnimation) - { + if ( !self.isPositiveAnimation ) { // This may not exist if we didn't present with this guy originally. If not, it will just do an alpha fade, no blur. UIImageView *blurImageView = objc_getAssociatedObject(fromViewController, &kRZZoomBlurImageAssocKey); @@ -72,8 +71,7 @@ - (void)animateTransition:(id)transitionCo fromViewController.view.opaque = NO; [container insertSubview:toViewController.view belowSubview:fromViewController.view]; - if (blurImageView) - { + if ( blurImageView ) { [container insertSubview:blurImageView aboveSubview:toViewController.view]; } @@ -93,8 +91,7 @@ - (void)animateTransition:(id)transitionCo [transitionContext completeTransition:!transitionContext.transitionWasCancelled]; }]; } - else - { + else { UIImage *blurImage = [UIImage blurredImageByCapturingView:fromViewController.view withRadius:self.blurRadius tintColor:self.blurTintColor saturationDeltaFactor:self.saturationDelta]; UIImageView *blurImageView = [[UIImageView alloc] initWithImage:blurImage]; objc_setAssociatedObject(toViewController, &kRZZoomBlurImageAssocKey, blurImageView, OBJC_ASSOCIATION_RETAIN_NONATOMIC); diff --git a/RZTransitions/Transitions/RZZoomPushAnimationController.m b/RZTransitions/Transitions/RZZoomPushAnimationController.m index 0c4a638..908063f 100644 --- a/RZTransitions/Transitions/RZZoomPushAnimationController.m +++ b/RZTransitions/Transitions/RZZoomPushAnimationController.m @@ -27,7 +27,7 @@ // #import "RZZoomPushAnimationController.h" -#import "RZHorizontalInteractionController.h" +#import #define kRZPushTransitionTime 0.35 #define kRZPushScaleChangePct 0.33 @@ -42,11 +42,11 @@ - (void)animateTransition:(id)transitionCo UIViewController *toViewController = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey]; UIView *container = [transitionContext containerView]; - if (self.isPositiveAnimation) - { + if ( self.isPositiveAnimation ) { [container insertSubview:toViewController.view belowSubview:fromViewController.view]; toViewController.view.transform = CGAffineTransformMakeScale(1.0 - kRZPushScaleChangePct, 1.0 - kRZPushScaleChangePct); - + + //! TODO: We shouldn't really call viewWillAppear here.. [toViewController viewWillAppear:YES]; [UIView animateWithDuration:kRZPushTransitionTime delay:0 @@ -63,8 +63,7 @@ - (void)animateTransition:(id)transitionCo [transitionContext completeTransition:!transitionContext.transitionWasCancelled]; }]; } - else - { + else { [container addSubview:toViewController.view]; toViewController.view.transform = CGAffineTransformMakeScale(1.0 + kRZPushScaleChangePct, 1.0 + kRZPushScaleChangePct); toViewController.view.alpha = 0.0f; From 404878d5c352e1301c537e24eaf627a0d5855dd6 Mon Sep 17 00:00:00 2001 From: Alex Rouse Date: Fri, 28 Nov 2014 09:51:42 -0500 Subject: [PATCH 3/9] Adding back in the pch so the build doesn't fail --- .../RZTransitions-Demo/RZTransitions-Demo-Prefix.pch | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/RZTransitions-Demo/RZTransitions-Demo/RZTransitions-Demo-Prefix.pch b/RZTransitions-Demo/RZTransitions-Demo/RZTransitions-Demo-Prefix.pch index fbe8d11..82a2bb4 100644 --- a/RZTransitions-Demo/RZTransitions-Demo/RZTransitions-Demo-Prefix.pch +++ b/RZTransitions-Demo/RZTransitions-Demo/RZTransitions-Demo-Prefix.pch @@ -4,3 +4,13 @@ // The contents of this file are implicitly included at the beginning of every source file. // +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif From bfaee347d29339a69deff4ba7eb2a990c12cdd2d Mon Sep 17 00:00:00 2001 From: Alex Rouse Date: Mon, 1 Dec 2014 09:48:42 -0500 Subject: [PATCH 4/9] Updating more comments and code style --- .../RZTransitions-Demo-Prefix.pch | 10 --- RZTransitions/Data/RZTransitionAction.h | 3 + RZTransitions/Data/RZUniqueTransition.h | 9 +++ RZTransitions/Data/RZUniqueTransition.m | 4 +- .../RZBaseSwipeInteractionController.h | 51 ++++++++++++++- .../RZBaseSwipeInteractionController.m | 34 +++++----- .../RZOverscrollInteractionController.h | 18 +++++- .../RZOverscrollInteractionController.m | 64 +++++++------------ .../RZPinchInteractionController.h | 21 +++++- .../RZPinchInteractionController.m | 27 ++++---- ...ZTransitionInteractionControllerProtocol.h | 9 +-- .../RZVerticalSwipeInteractionController.m | 4 +- RZTransitions/Managers/RZTransitionsManager.h | 1 + RZTransitions/Managers/RZTransitionsManager.m | 53 ++++++--------- .../UIImage+RZTransitionsFastImageBlur.h | 14 +++- .../UIImage+RZTransitionsFastImageBlur.m | 25 ++++---- .../UIImage+RZTransitionsSnapshotHelpers.h | 32 +++------- .../UIImage+RZTransitionsSnapshotHelpers.m | 23 ------- 18 files changed, 207 insertions(+), 195 deletions(-) diff --git a/RZTransitions-Demo/RZTransitions-Demo/RZTransitions-Demo-Prefix.pch b/RZTransitions-Demo/RZTransitions-Demo/RZTransitions-Demo-Prefix.pch index 82a2bb4..fbe8d11 100644 --- a/RZTransitions-Demo/RZTransitions-Demo/RZTransitions-Demo-Prefix.pch +++ b/RZTransitions-Demo/RZTransitions-Demo/RZTransitions-Demo-Prefix.pch @@ -4,13 +4,3 @@ // The contents of this file are implicitly included at the beginning of every source file. // -#import - -#ifndef __IPHONE_5_0 -#warning "This project uses features only available in iOS SDK 5.0 and later." -#endif - -#ifdef __OBJC__ - #import - #import -#endif diff --git a/RZTransitions/Data/RZTransitionAction.h b/RZTransitions/Data/RZTransitionAction.h index 6743a7d..348323b 100644 --- a/RZTransitions/Data/RZTransitionAction.h +++ b/RZTransitions/Data/RZTransitionAction.h @@ -31,6 +31,9 @@ #define kRZTransitionActionCount 5 +/** + * All the recognized transition action types. + */ typedef NS_ENUM (NSInteger, RZTransitionAction) { RZTransitionAction_Push = (1 << 0), RZTransitionAction_Pop = (1 << 1), diff --git a/RZTransitions/Data/RZUniqueTransition.h b/RZTransitions/Data/RZUniqueTransition.h index 7794085..80e1cd3 100644 --- a/RZTransitions/Data/RZUniqueTransition.h +++ b/RZTransitions/Data/RZUniqueTransition.h @@ -46,6 +46,15 @@ */ @property (assign, nonatomic) Class toViewControllerClass; +/** + * Creates a new @c RZUniqueTransition for use with the RZTransition Manager + * + * @param action The action that is to be used in the presentation/dismisall of the View controller + * @param fromViewController The ViewController class that will be going away. + * @param toViewController The ViewController class that will be presented. + * + * @return Instance of @c RZUniqueTransition + */ - (instancetype)initWithAction:(RZTransitionAction)action withFromViewControllerClass:(Class)fromViewController withToViewControllerClass:(Class)toViewController; diff --git a/RZTransitions/Data/RZUniqueTransition.m b/RZTransitions/Data/RZUniqueTransition.m index 55ae31d..afddea0 100644 --- a/RZTransitions/Data/RZUniqueTransition.m +++ b/RZTransitions/Data/RZUniqueTransition.m @@ -41,7 +41,7 @@ - (instancetype)initWithAction:(RZTransitionAction)action withToViewControllerClass:(Class)toViewController { self = [super init]; - if (self) { + if ( self ) { _transitionAction = action; _fromViewControllerClass = fromViewController; _toViewControllerClass = toViewController; @@ -49,7 +49,7 @@ - (instancetype)initWithAction:(RZTransitionAction)action return self; } -- (id)copyWithZone:(NSZone *)zone +- (instancetype)copyWithZone:(NSZone *)zone { RZUniqueTransition *copiedObject = [[[self class] allocWithZone:zone] init]; diff --git a/RZTransitions/Interactors/RZBaseSwipeInteractionController.h b/RZTransitions/Interactors/RZBaseSwipeInteractionController.h index 07cd987..b88dca4 100644 --- a/RZTransitions/Interactors/RZBaseSwipeInteractionController.h +++ b/RZTransitions/Interactors/RZBaseSwipeInteractionController.h @@ -27,18 +27,63 @@ // #import +#import + #import "RZTransitionInteractionControllerProtocol.h" @interface RZBaseSwipeInteractionController : UIPercentDrivenInteractiveTransition -@property (nonatomic, strong) UIViewController *fromViewController; -@property (nonatomic, strong) UIPanGestureRecognizer *gestureRecognizer; -@property (nonatomic, assign) BOOL reverseGestureDirection; +/** + * The ViewController that is doing the presenting. + */ +@property (strong, nonatomic) UIViewController *fromViewController; + +/** + * The GestureRecognizer to get information about the swipe. + */ +@property (strong, nonatomic) UIPanGestureRecognizer *gestureRecognizer; + +/** + * flag to know if the gesture is happening in the reverse direction. + */ +@property (assign, nonatomic) BOOL reverseGestureDirection; +/** + * Subclasses must overide this. + * + * @param panGestureRecognizer Pan gesture to check if the movement is positive. + * + * @return Flag if the gesture is in the positive or negative direction. + */ - (BOOL)isGesturePositive:(UIPanGestureRecognizer *)panGestureRecognizer; + +/** + * Subclass should overide this. + * The value that needs to be hit by the gesture recognizer to consider the transition happening. + * + * @return The percentage of the full amount that needs to be reached to complete the transition. + */ - (CGFloat)swipeCompletionPercent; + +/** + * Subclass must overide this. + * The translation percentage that the passed in gesture recognizer is at + * + * @param panGestureRecognizer The Gesture recognizer being tested + * + * @return The percentage of the translation that is complete + */ - (CGFloat)translationPercentageWithPanGestureRecongizer:(UIPanGestureRecognizer *)panGestureRecognizer; + +/** + * Subclass must overide this. + * The physical translation that is on the the view due to the panGestureRecognizer + * + * @param panGestureRecognizer the gesture recognizer being tested + * + * @return the translation that is currently on the view. + */ - (CGFloat)translationWithPanGestureRecongizer:(UIPanGestureRecognizer *)panGestureRecognizer; @end diff --git a/RZTransitions/Interactors/RZBaseSwipeInteractionController.m b/RZTransitions/Interactors/RZBaseSwipeInteractionController.m index a2db2da..ba48333 100644 --- a/RZTransitions/Interactors/RZBaseSwipeInteractionController.m +++ b/RZTransitions/Interactors/RZBaseSwipeInteractionController.m @@ -37,10 +37,10 @@ @implementation RZBaseSwipeInteractionController @synthesize nextViewControllerDelegate = _delegate; @synthesize shouldCompleteTransition = _shouldCompleteTransition; -- (id)init +- (instancetype)init { self = [super init]; - if (self) { + if ( self ) { _reverseGestureDirection = NO; } return self; @@ -74,35 +74,33 @@ - (void)handlePanGesture:(UIPanGestureRecognizer *)panGestureRecognizer CGFloat percentage = [self translationPercentageWithPanGestureRecongizer:panGestureRecognizer]; BOOL positiveDirection = self.reverseGestureDirection ? ![self isGesturePositive:panGestureRecognizer] : [self isGesturePositive:panGestureRecognizer]; - switch (panGestureRecognizer.state) { + switch ( panGestureRecognizer.state ) { case UIGestureRecognizerStateBegan: self.isInteractive = YES; - if (positiveDirection && self.nextViewControllerDelegate && [self.nextViewControllerDelegate conformsToProtocol:@protocol(RZTransitionInteractionControllerDelegate)]) - { - if (self.action & RZTransitionAction_Push) { + if ( positiveDirection && self.nextViewControllerDelegate && + [self.nextViewControllerDelegate conformsToProtocol:@protocol(RZTransitionInteractionControllerDelegate)] ) { + if ( self.action & RZTransitionAction_Push ) { [self.fromViewController.navigationController pushViewController:[self.nextViewControllerDelegate nextViewControllerForInteractor:self] animated:YES]; } - else if (self.action & RZTransitionAction_Present) { + else if ( self.action & RZTransitionAction_Present ) { // TODO: set and store a completion [self.fromViewController presentViewController:[self.nextViewControllerDelegate nextViewControllerForInteractor:self] animated:YES completion:nil]; } } - else - { - if (self.action & RZTransitionAction_Pop) { + else { + if ( self.action & RZTransitionAction_Pop ) { [self.fromViewController.navigationController popViewControllerAnimated:YES]; } - else if (self.action & RZTransitionAction_Dismiss) { + else if ( self.action & RZTransitionAction_Dismiss ) { [self.fromViewController dismissViewControllerAnimated:YES completion:nil]; } } break; case UIGestureRecognizerStateChanged: - if (self.isInteractive) - { - self.shouldCompleteTransition = (percentage > [self swipeCompletionPercent]); + if ( self.isInteractive ) { + self.shouldCompleteTransition = ( percentage > [self swipeCompletionPercent] ); [self updateInteractiveTransition:percentage]; } break; @@ -113,10 +111,9 @@ - (void)handlePanGesture:(UIPanGestureRecognizer *)panGestureRecognizer break; case UIGestureRecognizerStateEnded: - if (self.isInteractive) - { + if ( self.isInteractive ) { self.isInteractive = NO; - if (!self.shouldCompleteTransition || panGestureRecognizer.state == UIGestureRecognizerStateCancelled) { + if ( !self.shouldCompleteTransition || panGestureRecognizer.state == UIGestureRecognizerStateCancelled ) { [self cancelInteractiveTransition]; } else { @@ -159,8 +156,7 @@ - (CGFloat)translationWithPanGestureRecongizer:(UIPanGestureRecognizer *)panGest - (UIGestureRecognizer*)gestureRecognizer { - if (!_gestureRecognizer) - { + if ( !_gestureRecognizer ) { _gestureRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePanGesture:)]; [_gestureRecognizer setDelegate:self]; } diff --git a/RZTransitions/Interactors/RZOverscrollInteractionController.h b/RZTransitions/Interactors/RZOverscrollInteractionController.h index ac145d7..04de84b 100644 --- a/RZTransitions/Interactors/RZOverscrollInteractionController.h +++ b/RZTransitions/Interactors/RZOverscrollInteractionController.h @@ -27,14 +27,30 @@ // #import +#import + #import "RZTransitionInteractionControllerProtocol.h" @interface RZOverscrollInteractionController : UIPercentDrivenInteractiveTransition -@property(nonatomic, strong) UIViewController *fromViewController; +/** + * The View Controller that is being transitioned from. + */ +@property(strong, nonatomic) UIViewController *fromViewController; +/** + * The scrollview that is being watched to see if the overscroll is happening. + * + * @param scrollView the scrollview + */ - (void)watchScrollView:(UIScrollView*)scrollView; + +/** + * The percentage of the transition that is needed to complete + * + * @return 0 to 1 percentage. + */ - (CGFloat)completionPercent; @end diff --git a/RZTransitions/Interactors/RZOverscrollInteractionController.m b/RZTransitions/Interactors/RZOverscrollInteractionController.m index 9ccb5a6..803003e 100644 --- a/RZTransitions/Interactors/RZOverscrollInteractionController.m +++ b/RZTransitions/Interactors/RZOverscrollInteractionController.m @@ -28,14 +28,14 @@ #import "RZOverscrollInteractionController.h" -#define kRZOverscrollInteractionDefaultCompletionPercentage 0.35f -#define kRZOverscrollInteractionDefaultTopStartDistance 25.0f -#define kRZOverscrollInteractionDefaultBottomStartDistance 25.0f -#define kRZOverscrollInteractionDefaultTranslationDistance 200.0f +static CGFloat const kRZOverscrollInteractionDefaultCompletionPercentage = 0.35f; +static CGFloat const kRZOverscrollInteractionDefaultTopStartDistance = 25.0f; +static CGFloat const kRZOverscrollInteractionDefaultBottomStartDistance = 25.0f; +static CGFloat const kRZOverscrollInteractionDefaultTranslationDistance = 200.0f; @interface RZOverscrollInteractionController () -@property (nonatomic, assign) CGFloat lastYOffset; +@property (assign, nonatomic) CGFloat lastYOffset; @end @@ -75,24 +75,20 @@ - (CGFloat)completionPercent - (CGFloat)translationPercentageWithScrollView:(UIScrollView *)scrollView isScrollingDown:(BOOL)isScrollingDown { - if (isScrollingDown) - { + if ( isScrollingDown ) { return ((scrollView.contentOffset.y + kRZOverscrollInteractionDefaultTopStartDistance) / kRZOverscrollInteractionDefaultTranslationDistance) * -1; } - else - { + else { return ((scrollView.contentOffset.y + scrollView.frame.size.height - scrollView.contentSize.height - kRZOverscrollInteractionDefaultBottomStartDistance) / kRZOverscrollInteractionDefaultTranslationDistance); } } - (BOOL)scrollViewPastStartLocationWithScrollView:(UIScrollView *)scrollview isScrollingDown:(BOOL)isScrollingDown { - if (isScrollingDown) - { + if ( isScrollingDown ) { return (scrollview.contentOffset.y < kRZOverscrollInteractionDefaultTopStartDistance); } - else - { + else { return ((scrollview.contentOffset.y + scrollview.frame.size.height - scrollview.contentSize.height) > kRZOverscrollInteractionDefaultBottomStartDistance); } } @@ -105,11 +101,9 @@ - (void)updateInteractionWithPercentage:(CGFloat)percentage - (void)completeInteractionWithScrollView:(UIScrollView *)scrollView { - if (self.isInteractive) - { + if ( self.isInteractive ) { self.isInteractive = NO; - if(self.shouldCompleteTransition) - { + if( self.shouldCompleteTransition ) { [scrollView setDelegate:nil]; } self.shouldCompleteTransition ? [self finishInteractiveTransition] : [self cancelInteractiveTransition]; @@ -118,23 +112,18 @@ - (void)completeInteractionWithScrollView:(UIScrollView *)scrollView - (void)beginTransition { - if (!self.isInteractive) - { + if ( !self.isInteractive ) { self.isInteractive = YES; - if (self.action & RZTransitionAction_Push) - { + if ( self.action & RZTransitionAction_Push ) { [self.fromViewController.navigationController pushViewController:[self.nextViewControllerDelegate nextViewControllerForInteractor:self] animated:YES]; } - else if (self.action & RZTransitionAction_Present) - { + else if ( self.action & RZTransitionAction_Present ) { [self.fromViewController presentViewController:[self.nextViewControllerDelegate nextViewControllerForInteractor:self] animated:YES completion:nil]; } - else if (self.action & RZTransitionAction_Pop) - { + else if ( self.action & RZTransitionAction_Pop ) { [self.fromViewController.navigationController popViewControllerAnimated:YES]; } - else if (self.action & RZTransitionAction_Dismiss) - { + else if ( self.action & RZTransitionAction_Dismiss ) { [self.fromViewController dismissViewControllerAnimated:YES completion:nil]; } } @@ -172,32 +161,25 @@ - (void)scrollViewDidScroll:(UIScrollView *)scrollView BOOL scrollViewPastStartLocation = [self scrollViewPastStartLocationWithScrollView:scrollView isScrollingDown:overScrollDown]; BOOL scrollingDirectionUp = scrollView.contentOffset.y - self.lastYOffset < 0; - if (!scrollViewPastStartLocation) - { + if ( !scrollViewPastStartLocation ) { return; } CGFloat percentage = [self translationPercentageWithScrollView:scrollView isScrollingDown:overScrollDown]; - if (overScrollDown && [RZOverscrollInteractionController actionIsPushOrPresentWithAction:self.action]) - { - if (!self.isInteractive && scrollingDirectionUp && scrollViewPastStartLocation && !scrollView.isDecelerating) - { + if ( overScrollDown && [RZOverscrollInteractionController actionIsPushOrPresentWithAction:self.action] ) { + if ( !self.isInteractive && scrollingDirectionUp && scrollViewPastStartLocation && !scrollView.isDecelerating ) { [self beginTransition]; } - else if (scrollViewPastStartLocation) - { + else if ( scrollViewPastStartLocation ) { [self updateInteractionWithPercentage:percentage]; } } - else if (overScrollUp && [RZOverscrollInteractionController actionIsDismissOrPopWithAction:self.action]) - { - if (!self.isInteractive && !scrollingDirectionUp && scrollViewPastStartLocation && !scrollView.isDecelerating) - { + else if ( overScrollUp && [RZOverscrollInteractionController actionIsDismissOrPopWithAction:self.action] ) { + if ( !self.isInteractive && !scrollingDirectionUp && scrollViewPastStartLocation && !scrollView.isDecelerating ) { [self beginTransition]; } - else if (scrollViewPastStartLocation) - { + else if ( scrollViewPastStartLocation ) { [self updateInteractionWithPercentage:percentage]; } } diff --git a/RZTransitions/Interactors/RZPinchInteractionController.h b/RZTransitions/Interactors/RZPinchInteractionController.h index 4d9d61f..0ba3819 100644 --- a/RZTransitions/Interactors/RZPinchInteractionController.h +++ b/RZTransitions/Interactors/RZPinchInteractionController.h @@ -27,14 +27,31 @@ // #import +#import +#import + #import "RZTransitionInteractionControllerProtocol.h" @interface RZPinchInteractionController : UIPercentDrivenInteractiveTransition -@property(nonatomic, strong) UIViewController *fromViewController; -@property(nonatomic, strong) UIPinchGestureRecognizer *gestureRecognizer; +/** + * The View Controller that is being transitioned from. + */ +@property(strong, nonatomic) UIViewController *fromViewController; + +/** + * The Pinch Gesture recognizer that is used to control the interaction + */ +@property(strong, nonatomic) UIPinchGestureRecognizer *gestureRecognizer; +/** + * The percent of the translation percentage + * + * @param pinchGestureRecognizer The pinch gesture that is being measured + * + * @return percentage from 0 to 1 + */ - (CGFloat)translationPercentageWithPinchGestureRecognizer:(UIPinchGestureRecognizer *)pinchGestureRecognizer; @end diff --git a/RZTransitions/Interactors/RZPinchInteractionController.m b/RZTransitions/Interactors/RZPinchInteractionController.m index 90eadf8..283fd51 100644 --- a/RZTransitions/Interactors/RZPinchInteractionController.m +++ b/RZTransitions/Interactors/RZPinchInteractionController.m @@ -28,7 +28,7 @@ #import "RZPinchInteractionController.h" -#define kRZPinchInteractionDefaultCompletionPercentage 0.5f +static CGFloat const kRZPinchInteractionDefaultCompletionPercentage = 0.5f; @implementation RZPinchInteractionController @@ -75,33 +75,31 @@ - (void)handlePinchGesture:(UIPinchGestureRecognizer *)pinchGestureRecognizer CGFloat percentage = [self translationPercentageWithPinchGestureRecognizer:pinchGestureRecognizer]; BOOL isPinch = [self isPinchWithGesture:pinchGestureRecognizer]; - switch (pinchGestureRecognizer.state) { + switch ( pinchGestureRecognizer.state ) { case UIGestureRecognizerStateBegan: self.isInteractive = YES; - if (!isPinch && self.nextViewControllerDelegate && [self.nextViewControllerDelegate conformsToProtocol:@protocol(RZTransitionInteractionControllerDelegate)]) - { - if (self.action & RZTransitionAction_Push) { + if ( !isPinch && self.nextViewControllerDelegate && [self.nextViewControllerDelegate conformsToProtocol:@protocol(RZTransitionInteractionControllerDelegate)] ) { + if ( self.action & RZTransitionAction_Push ) { [self.fromViewController.navigationController pushViewController:[self.nextViewControllerDelegate nextViewControllerForInteractor:self] animated:YES]; } - else if (self.action & RZTransitionAction_Present) { + else if ( self.action & RZTransitionAction_Present ) { // TODO: set and store a completion [self.fromViewController presentViewController:[self.nextViewControllerDelegate nextViewControllerForInteractor:self] animated:YES completion:nil]; } } - else - { - if (self.action & RZTransitionAction_Pop) { + else { + if ( self.action & RZTransitionAction_Pop ) { [self.fromViewController.navigationController popViewControllerAnimated:YES]; } - else if (self.action & RZTransitionAction_Dismiss) { + else if ( self.action & RZTransitionAction_Dismiss ) { [self.fromViewController dismissViewControllerAnimated:YES completion:nil]; } } break; case UIGestureRecognizerStateChanged: - if (self.isInteractive) { + if ( self.isInteractive ) { self.shouldCompleteTransition = (percentage > kRZPinchInteractionDefaultCompletionPercentage); [self updateInteractiveTransition:percentage]; } @@ -113,9 +111,9 @@ - (void)handlePinchGesture:(UIPinchGestureRecognizer *)pinchGestureRecognizer break; case UIGestureRecognizerStateEnded: - if (self.isInteractive) { + if ( self.isInteractive ) { self.isInteractive = NO; - if (!self.shouldCompleteTransition || pinchGestureRecognizer.state == UIGestureRecognizerStateCancelled) { + if ( !self.shouldCompleteTransition || pinchGestureRecognizer.state == UIGestureRecognizerStateCancelled ) { [self cancelInteractiveTransition]; } else { @@ -132,8 +130,7 @@ - (void)handlePinchGesture:(UIPinchGestureRecognizer *)pinchGestureRecognizer - (UIGestureRecognizer*)gestureRecognizer { - if (!_gestureRecognizer) - { + if ( !_gestureRecognizer ) { _gestureRecognizer = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(handlePinchGesture:)]; [_gestureRecognizer setDelegate:self]; } diff --git a/RZTransitions/Interactors/RZTransitionInteractionControllerProtocol.h b/RZTransitions/Interactors/RZTransitionInteractionControllerProtocol.h index 3946717..bb01c25 100644 --- a/RZTransitions/Interactors/RZTransitionInteractionControllerProtocol.h +++ b/RZTransitions/Interactors/RZTransitionInteractionControllerProtocol.h @@ -27,6 +27,7 @@ // #import "RZTransitionAction.h" +#import #ifndef RZTransitions_RZTransitionInteractorProtocol_h #define RZTransitions_RZTransitionInteractorProtocol_h @@ -56,22 +57,22 @@ /** * Is the transition interaction controller currently in a user interaction state. */ -@property (nonatomic, assign, readwrite) BOOL isInteractive; +@property (assign, nonatomic, readwrite) BOOL isInteractive; /** * Should the transition interaction controller complete the transaction if it is released in its current state. Ex: a swipe interactor should not complete until it has passed a threshold percentage. */ -@property (nonatomic, assign, readwrite) BOOL shouldCompleteTransition; +@property (assign ,nonatomic, readwrite) BOOL shouldCompleteTransition; /** * The bitmap of actions that a transition interaction controller will complete for. */ -@property (nonatomic, assign, readwrite) RZTransitionAction action; +@property (assign, nonatomic, readwrite) RZTransitionAction action; /** * The delegate that allows the interaction controller to receive a @UIViewController to display for positive actions such as push and present. */ -@property (nonatomic, weak) id nextViewControllerDelegate; +@property (weak, nonatomic) id nextViewControllerDelegate; /** * Initialize the Interaction Controller in the supplied @c UIViewController. Typically adds a gesture recognizer to the @c UIViewController's view. diff --git a/RZTransitions/Interactors/RZVerticalSwipeInteractionController.m b/RZTransitions/Interactors/RZVerticalSwipeInteractionController.m index afcf31d..28bcb06 100644 --- a/RZTransitions/Interactors/RZVerticalSwipeInteractionController.m +++ b/RZTransitions/Interactors/RZVerticalSwipeInteractionController.m @@ -56,8 +56,8 @@ - (CGFloat)translationWithPanGestureRecongizer:(UIPanGestureRecognizer *)panGest - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer { - if ([gestureRecognizer isKindOfClass:[UIPanGestureRecognizer class]]) { - UIPanGestureRecognizer *panGestureRecognizer = (UIPanGestureRecognizer*)gestureRecognizer; + if ( [gestureRecognizer isKindOfClass:[UIPanGestureRecognizer class]] ) { + UIPanGestureRecognizer *panGestureRecognizer = (UIPanGestureRecognizer *)gestureRecognizer; CGFloat xTranslation = [panGestureRecognizer translationInView:panGestureRecognizer.view].x; return xTranslation == 0; } diff --git a/RZTransitions/Managers/RZTransitionsManager.h b/RZTransitions/Managers/RZTransitionsManager.h index e846993..3d71977 100644 --- a/RZTransitions/Managers/RZTransitionsManager.h +++ b/RZTransitions/Managers/RZTransitionsManager.h @@ -27,6 +27,7 @@ // #import +#import #import "RZTransitionAction.h" @protocol RZAnimationControllerProtocol; diff --git a/RZTransitions/Managers/RZTransitionsManager.m b/RZTransitions/Managers/RZTransitionsManager.m index 597fcb3..8d446df 100644 --- a/RZTransitions/Managers/RZTransitionsManager.m +++ b/RZTransitions/Managers/RZTransitionsManager.m @@ -49,16 +49,16 @@ + (RZTransitionsManager *)shared static RZTransitionsManager *_defaultManager = nil; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ - _defaultManager = [[[self class] alloc] init]; + _defaultManager = [[self alloc] init]; }); return _defaultManager; } -- (id)init +- (instancetype)init { self = [super init]; - if (self) { + if ( self ) { self.animationControllers = [[NSMutableDictionary alloc] init]; self.animationControllerDirectionOverrides = [[NSMutableDictionary alloc] init]; self.interactionControllers = [[NSMutableDictionary alloc] init]; @@ -82,9 +82,8 @@ - (RZUniqueTransition *)setAnimationController:(id interactionController = (id)[self.interactionControllers objectForKey:keyValue]; - if (interactionController == nil) { + if ( interactionController == nil ) { keyValue.toViewControllerClass = nil; interactionController = (id)[self.interactionControllers objectForKey:keyValue]; } - if( (interactionController != nil) && (interactionController.isInteractive)) { + if( (interactionController != nil) && (interactionController.isInteractive) ) { returnInteraction = interactionController; *stop = YES; } @@ -226,11 +224,11 @@ - (void)overrideAnimationDirection:(BOOL)override withTransition:(RZUniqueTransi RZUniqueTransition *keyValue = (RZUniqueTransition *)key; if ( animator == animationController && keyValue.transitionAction & RZTransitionAction_Dismiss ) { id interactionController = (id)[self.interactionControllers objectForKey:keyValue]; - if (interactionController == nil) { + if ( interactionController == nil ) { keyValue.fromViewControllerClass = nil; interactionController = (id)[self.interactionControllers objectForKey:keyValue]; } - if( (interactionController != nil) && (interactionController.isInteractive)) { + if( (interactionController != nil) && (interactionController.isInteractive) ) { returnInteraction = interactionController; *stop = YES; } @@ -242,16 +240,6 @@ - (void)overrideAnimationDirection:(BOOL)override withTransition:(RZUniqueTransi #pragma mark - UINavigationControllerDelegate -- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated -{ - -} - -- (void)navigationController:(UINavigationController *)navigationController didShowViewController:(UIViewController *)viewController animated:(BOOL)animated -{ - -} - - (id )navigationController:(UINavigationController *)navigationController interactionControllerForAnimationController:(id ) animationController { @@ -267,23 +255,23 @@ - (void)navigationController:(UINavigationController *)navigationController didS withFromViewControllerClass:[fromVC class] withToViewControllerClass:[toVC class]]; id animationController = (id)[self.animationControllers objectForKey:keyValue]; - if (animationController == nil) { + if ( animationController == nil ) { keyValue.toViewControllerClass = nil; animationController = (id)[self.animationControllers objectForKey:keyValue]; } - if (animationController == nil) { + if ( animationController == nil ) { keyValue.toViewControllerClass = [toVC class]; keyValue.fromViewControllerClass = nil; animationController = (id)[self.animationControllers objectForKey:keyValue]; } - if (animationController == nil) { + if ( animationController == nil ) { animationController = self.defaultPushPopAnimationController; } if ( ![[self.animationControllerDirectionOverrides objectForKey:keyValue] boolValue] ) { - if (operation == UINavigationControllerOperationPush) { + if ( operation == UINavigationControllerOperationPush ) { animationController.isPositiveAnimation = YES; - } else if (operation == UINavigationControllerOperationPop) { + } else if ( operation == UINavigationControllerOperationPop ) { animationController.isPositiveAnimation = NO; } } @@ -295,9 +283,9 @@ - (void)navigationController:(UINavigationController *)navigationController didS - (id )interactionControllerForAction:(RZTransitionAction)action withAnimationController:(id )animationController { - for (RZUniqueTransition *key in self.interactionControllers) { + for ( RZUniqueTransition *key in self.interactionControllers ) { id interactionController = [self.interactionControllers objectForKey:key]; - if ((interactionController.action & action) && [interactionController isInteractive]) { + if ( (interactionController.action & action) && [interactionController isInteractive] ) { return interactionController; } } @@ -307,11 +295,6 @@ - (void)navigationController:(UINavigationController *)navigationController didS #pragma mark - UITabBarControllerDelegate -- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController -{ - -} - - (id )tabBarController:(UITabBarController *)tabBarController interactionControllerForAnimationController:(id )animationController { diff --git a/RZTransitions/Utilities/UIImage+RZTransitionsFastImageBlur.h b/RZTransitions/Utilities/UIImage+RZTransitionsFastImageBlur.h index 68e2bf3..5e32250 100644 --- a/RZTransitions/Utilities/UIImage+RZTransitionsFastImageBlur.h +++ b/RZTransitions/Utilities/UIImage+RZTransitionsFastImageBlur.h @@ -100,11 +100,23 @@ 5/3/2013 */ -@import UIKit; + +#import +#import @interface UIImage (RZTransitionsFastImageBlur) // tint color ONLY APPLIES when blurring radius is non-negligible +/** + * gets an image from a view and blurs it using a modification on Apple's bluring code to speed it up. + * + * @param view The view to be blured + * @param blurRadius The radius of the blur + * @param tintColor A color to tint the blur. Only applies if the blur radius is not zero. + * @param saturationDeltaFactor The saturation delta that should be applied to the blur. + * + * @return A UIImage used for the view pass + */ + (UIImage *)blurredImageByCapturingView:(UIView*)view withRadius:(CGFloat)blurRadius tintColor:(UIColor*)tintColor saturationDeltaFactor:(CGFloat)saturationDeltaFactor; @end diff --git a/RZTransitions/Utilities/UIImage+RZTransitionsFastImageBlur.m b/RZTransitions/Utilities/UIImage+RZTransitionsFastImageBlur.m index 2f277dd..5204fd4 100644 --- a/RZTransitions/Utilities/UIImage+RZTransitionsFastImageBlur.m +++ b/RZTransitions/Utilities/UIImage+RZTransitionsFastImageBlur.m @@ -92,7 +92,7 @@ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF #import "UIImage+RZTransitionsFastImageBlur.h" -@import Accelerate; +#import #import @@ -109,7 +109,7 @@ + (UIImage *)blurredImageByCapturingView:(UIView *)view withRadius:(CGFloat)blur BOOL hasBlur = blurRadius > __FLT_EPSILON__; BOOL hasSaturationChange = fabs(saturationDeltaFactor - 1.) > __FLT_EPSILON__; - if (hasBlur || hasSaturationChange) { + if ( hasBlur || hasSaturationChange ) { CGContextRef effectInContext = UIGraphicsGetCurrentContext(); @@ -127,7 +127,7 @@ + (UIImage *)blurredImageByCapturingView:(UIView *)view withRadius:(CGFloat)blur effectOutBuffer.height = CGBitmapContextGetHeight(effectOutContext); effectOutBuffer.rowBytes = CGBitmapContextGetBytesPerRow(effectOutContext); - if (hasBlur) { + if ( hasBlur ) { // A description of how to compute the box kernel width from the Gaussian // radius (aka standard deviation) appears in the SVG spec: // http://www.w3.org/TR/SVG/filters.html#feGaussianBlurElement @@ -150,7 +150,7 @@ + (UIImage *)blurredImageByCapturingView:(UIView *)view withRadius:(CGFloat)blur vImageBoxConvolve_ARGB8888(&effectInBuffer, &effectOutBuffer, NULL, 0, 0, (uint32_t)radius, (uint32_t)radius, 0, kvImageEdgeExtend); } BOOL effectImageBuffersAreSwapped = NO; - if (hasSaturationChange) { + if ( hasSaturationChange ) { CGFloat s = saturationDeltaFactor; CGFloat floatingPointSaturationMatrix[] = { 0.0722 + 0.9278 * s, 0.0722 - 0.0722 * s, 0.0722 - 0.0722 * s, 0, @@ -161,10 +161,10 @@ + (UIImage *)blurredImageByCapturingView:(UIView *)view withRadius:(CGFloat)blur const int32_t divisor = 256; NSUInteger matrixSize = sizeof(floatingPointSaturationMatrix)/sizeof(floatingPointSaturationMatrix[0]); int16_t saturationMatrix[matrixSize]; - for (NSUInteger i = 0; i < matrixSize; ++i) { + for ( NSUInteger i = 0; i < matrixSize; ++i ) { saturationMatrix[i] = (int16_t)roundf(floatingPointSaturationMatrix[i] * divisor); } - if (hasBlur) { + if ( hasBlur ) { vImageMatrixMultiply_ARGB8888(&effectOutBuffer, &effectInBuffer, saturationMatrix, divisor, NULL, NULL, kvImageNoFlags); effectImageBuffersAreSwapped = YES; } @@ -173,10 +173,9 @@ + (UIImage *)blurredImageByCapturingView:(UIView *)view withRadius:(CGFloat)blur } } - if (!effectImageBuffersAreSwapped) - { + if ( !effectImageBuffersAreSwapped ) { // Add in color tint. - if (tintColor) { + if ( tintColor ) { CGContextSaveGState(effectOutContext); CGContextSetFillColorWithColor(effectOutContext, tintColor.CGColor); CGContextFillRect(effectOutContext, imageRect); @@ -188,10 +187,9 @@ + (UIImage *)blurredImageByCapturingView:(UIView *)view withRadius:(CGFloat)blur UIGraphicsEndImageContext(); - if (effectImageBuffersAreSwapped) - { + if ( effectImageBuffersAreSwapped ) { // Add in color tint. - if (tintColor) { + if ( tintColor ) { CGContextSaveGState(effectInContext); CGContextSetFillColorWithColor(effectInContext, tintColor.CGColor); CGContextFillRect(effectInContext, imageRect); @@ -201,8 +199,7 @@ + (UIImage *)blurredImageByCapturingView:(UIView *)view withRadius:(CGFloat)blur outputImage = UIGraphicsGetImageFromCurrentImageContext(); } } - else - { + else { outputImage = UIGraphicsGetImageFromCurrentImageContext(); } diff --git a/RZTransitions/Utilities/UIImage+RZTransitionsSnapshotHelpers.h b/RZTransitions/Utilities/UIImage+RZTransitionsSnapshotHelpers.h index 72c75c6..0a2b046 100644 --- a/RZTransitions/Utilities/UIImage+RZTransitionsSnapshotHelpers.h +++ b/RZTransitions/Utilities/UIImage+RZTransitionsSnapshotHelpers.h @@ -26,33 +26,19 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -// Copyright 2014 Raizlabs and other contributors -// http://raizlabs.com/ -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - #import @interface UIImage (RZTransitionsSnapshotHelpers) +/** + * Returns a UIImage from a UIView + * Uses [UIView drawViewHierarchyInRect:afterScreenupdates:] + * + * @param view The view to be captured + * @param waitForUpdate Flag to see if the screen should update before capturing the view + * + * @return The Image from the view. + */ + (UIImage *)imageByCapturingView:(UIView*)view afterScreenUpdate:(BOOL)waitForUpdate; @end diff --git a/RZTransitions/Utilities/UIImage+RZTransitionsSnapshotHelpers.m b/RZTransitions/Utilities/UIImage+RZTransitionsSnapshotHelpers.m index 98c43c9..0b65643 100644 --- a/RZTransitions/Utilities/UIImage+RZTransitionsSnapshotHelpers.m +++ b/RZTransitions/Utilities/UIImage+RZTransitionsSnapshotHelpers.m @@ -26,29 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -// Copyright 2014 Raizlabs and other contributors -// http://raizlabs.com/ -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - #import "UIImage+RZTransitionsSnapshotHelpers.h" @implementation UIImage (RZTransitionsSnapshotHelpers) From 4ae6cee9d4209c28f6b5055427217b0af8a66dee Mon Sep 17 00:00:00 2001 From: Alex Rouse Date: Mon, 1 Dec 2014 10:12:10 -0500 Subject: [PATCH 5/9] Fixing Readme super calls. --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 2887a45..0ad5b72 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,7 @@ UINavigationController *navigationController = [[UINavigationController alloc] i - (void)viewDidLoad { + [super viewDidLoad]; // Create the presentation interaction controller that allows a custom gesture // to control presenting a new VC via a presentViewController self.presentInteractionController = [[RZVerticalSwipeInteractionController alloc] init]; @@ -80,6 +81,7 @@ UINavigationController *navigationController = [[UINavigationController alloc] i - (void)viewWillAppear:(BOOL)animated { + [super viewWillAppear:animated]; // Use the present interaction controller for presenting any view controller from this view controller [[RZTransitionsManager shared] setInteractionController:self.presentInteractionController fromViewController:[self class] From 867311fc62b31c1073fc051421fba081315de921 Mon Sep 17 00:00:00 2001 From: Zev Eisenberg Date: Mon, 1 Dec 2014 10:51:50 -0500 Subject: [PATCH 6/9] Code style and cleanup. --- RZTransitions/Data/RZUniqueTransition.h | 2 +- .../Interactors/RZBaseSwipeInteractionController.h | 4 ++-- .../Interactors/RZBaseSwipeInteractionController.m | 5 +++-- .../Interactors/RZHorizontalInteractionController.m | 2 +- .../Interactors/RZOverscrollInteractionController.h | 4 ++-- .../Interactors/RZOverscrollInteractionController.m | 10 +++++----- .../Interactors/RZPinchInteractionController.h | 4 ++-- .../Interactors/RZPinchInteractionController.m | 7 ++++--- .../Transitions/RZCardSlideAnimationController.h | 2 +- .../Transitions/RZCirclePushAnimationController.h | 12 ++++++------ .../Transitions/RZRectZoomAnimationController.h | 12 ++++++------ .../Transitions/RZTransitionsAnimationControllers.h | 2 +- .../Transitions/RZZoomBlurAnimationController.h | 2 +- .../Transitions/RZZoomBlurAnimationController.m | 3 ++- .../Transitions/RZZoomPushAnimationController.m | 2 +- .../Utilities/UIImage+RZTransitionsFastImageBlur.h | 4 ++-- .../Utilities/UIImage+RZTransitionsSnapshotHelpers.h | 4 ++-- .../Utilities/UIImage+RZTransitionsSnapshotHelpers.m | 5 ++--- 18 files changed, 44 insertions(+), 42 deletions(-) diff --git a/RZTransitions/Data/RZUniqueTransition.h b/RZTransitions/Data/RZUniqueTransition.h index 80e1cd3..c4b467a 100644 --- a/RZTransitions/Data/RZUniqueTransition.h +++ b/RZTransitions/Data/RZUniqueTransition.h @@ -49,7 +49,7 @@ /** * Creates a new @c RZUniqueTransition for use with the RZTransition Manager * - * @param action The action that is to be used in the presentation/dismisall of the View controller + * @param action The action that is to be used in the presentation/dismissal of the View controller * @param fromViewController The ViewController class that will be going away. * @param toViewController The ViewController class that will be presented. * diff --git a/RZTransitions/Interactors/RZBaseSwipeInteractionController.h b/RZTransitions/Interactors/RZBaseSwipeInteractionController.h index b88dca4..c872189 100644 --- a/RZTransitions/Interactors/RZBaseSwipeInteractionController.h +++ b/RZTransitions/Interactors/RZBaseSwipeInteractionController.h @@ -68,7 +68,7 @@ /** * Subclass must overide this. - * The translation percentage that the passed in gesture recognizer is at + * The translation percentage of the passed gesture recognizer * * @param panGestureRecognizer The Gesture recognizer being tested * @@ -77,7 +77,7 @@ - (CGFloat)translationPercentageWithPanGestureRecongizer:(UIPanGestureRecognizer *)panGestureRecognizer; /** - * Subclass must overide this. + * Subclasses must override this. * The physical translation that is on the the view due to the panGestureRecognizer * * @param panGestureRecognizer the gesture recognizer being tested diff --git a/RZTransitions/Interactors/RZBaseSwipeInteractionController.m b/RZTransitions/Interactors/RZBaseSwipeInteractionController.m index ba48333..4e88392 100644 --- a/RZTransitions/Interactors/RZBaseSwipeInteractionController.m +++ b/RZTransitions/Interactors/RZBaseSwipeInteractionController.m @@ -53,7 +53,8 @@ - (void)attachViewController:(UIViewController *)viewController withAction:(RZTr [self attachGestureRecognizerToView:self.fromViewController.view]; } -- (void)attachGestureRecognizerToView:(UIView*)view { +- (void)attachGestureRecognizerToView:(UIView *)view +{ [view addGestureRecognizer:self.gestureRecognizer]; } @@ -154,7 +155,7 @@ - (CGFloat)translationWithPanGestureRecongizer:(UIPanGestureRecognizer *)panGest #pragma mark - Overridden Properties -- (UIGestureRecognizer*)gestureRecognizer +- (UIGestureRecognizer *)gestureRecognizer { if ( !_gestureRecognizer ) { _gestureRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePanGesture:)]; diff --git a/RZTransitions/Interactors/RZHorizontalInteractionController.m b/RZTransitions/Interactors/RZHorizontalInteractionController.m index 2bfbc0b..f6bda5a 100644 --- a/RZTransitions/Interactors/RZHorizontalInteractionController.m +++ b/RZTransitions/Interactors/RZHorizontalInteractionController.m @@ -57,7 +57,7 @@ - (CGFloat)translationWithPanGestureRecongizer:(UIPanGestureRecognizer *)panGest - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer { if ([gestureRecognizer isKindOfClass:[UIPanGestureRecognizer class]]) { - UIPanGestureRecognizer *panGestureRecognizer = (UIPanGestureRecognizer*)gestureRecognizer; + UIPanGestureRecognizer *panGestureRecognizer = (UIPanGestureRecognizer *)gestureRecognizer; CGFloat yTranslation = [panGestureRecognizer translationInView:panGestureRecognizer.view].y; return yTranslation == 0; } diff --git a/RZTransitions/Interactors/RZOverscrollInteractionController.h b/RZTransitions/Interactors/RZOverscrollInteractionController.h index 04de84b..4985a9b 100644 --- a/RZTransitions/Interactors/RZOverscrollInteractionController.h +++ b/RZTransitions/Interactors/RZOverscrollInteractionController.h @@ -37,14 +37,14 @@ /** * The View Controller that is being transitioned from. */ -@property(strong, nonatomic) UIViewController *fromViewController; +@property (strong, nonatomic) UIViewController *fromViewController; /** * The scrollview that is being watched to see if the overscroll is happening. * * @param scrollView the scrollview */ -- (void)watchScrollView:(UIScrollView*)scrollView; +- (void)watchScrollView:(UIScrollView *)scrollView; /** * The percentage of the transition that is needed to complete diff --git a/RZTransitions/Interactors/RZOverscrollInteractionController.m b/RZTransitions/Interactors/RZOverscrollInteractionController.m index 803003e..c99728d 100644 --- a/RZTransitions/Interactors/RZOverscrollInteractionController.m +++ b/RZTransitions/Interactors/RZOverscrollInteractionController.m @@ -28,10 +28,10 @@ #import "RZOverscrollInteractionController.h" -static CGFloat const kRZOverscrollInteractionDefaultCompletionPercentage = 0.35f; -static CGFloat const kRZOverscrollInteractionDefaultTopStartDistance = 25.0f; -static CGFloat const kRZOverscrollInteractionDefaultBottomStartDistance = 25.0f; -static CGFloat const kRZOverscrollInteractionDefaultTranslationDistance = 200.0f; +static const CGFloat kRZOverscrollInteractionDefaultCompletionPercentage = 0.35f; +static const CGFloat kRZOverscrollInteractionDefaultTopStartDistance = 25.0f; +static const CGFloat kRZOverscrollInteractionDefaultBottomStartDistance = 25.0f; +static const CGFloat kRZOverscrollInteractionDefaultTranslationDistance = 200.0f; @interface RZOverscrollInteractionController () @@ -54,7 +54,7 @@ - (void)attachViewController:(UIViewController *)viewController withAction:(RZTr self.action = action; } -- (void)watchScrollView:(UIScrollView*)scrollView +- (void)watchScrollView:(UIScrollView *)scrollView { [scrollView setDelegate:self]; } diff --git a/RZTransitions/Interactors/RZPinchInteractionController.h b/RZTransitions/Interactors/RZPinchInteractionController.h index 0ba3819..4bd3b60 100644 --- a/RZTransitions/Interactors/RZPinchInteractionController.h +++ b/RZTransitions/Interactors/RZPinchInteractionController.h @@ -38,12 +38,12 @@ /** * The View Controller that is being transitioned from. */ -@property(strong, nonatomic) UIViewController *fromViewController; +@property (strong, nonatomic) UIViewController *fromViewController; /** * The Pinch Gesture recognizer that is used to control the interaction */ -@property(strong, nonatomic) UIPinchGestureRecognizer *gestureRecognizer; +@property (strong, nonatomic) UIPinchGestureRecognizer *gestureRecognizer; /** * The percent of the translation percentage diff --git a/RZTransitions/Interactors/RZPinchInteractionController.m b/RZTransitions/Interactors/RZPinchInteractionController.m index 283fd51..d8438ca 100644 --- a/RZTransitions/Interactors/RZPinchInteractionController.m +++ b/RZTransitions/Interactors/RZPinchInteractionController.m @@ -28,7 +28,7 @@ #import "RZPinchInteractionController.h" -static CGFloat const kRZPinchInteractionDefaultCompletionPercentage = 0.5f; +static const CGFloat kRZPinchInteractionDefaultCompletionPercentage = 0.5f; @implementation RZPinchInteractionController @@ -44,7 +44,8 @@ - (void)attachViewController:(UIViewController *)viewController withAction:(RZTr [self attachGestureRecognizerToView:self.fromViewController.view]; } -- (void)attachGestureRecognizerToView:(UIView*)view { +- (void)attachGestureRecognizerToView:(UIView *)view +{ [view addGestureRecognizer:self.gestureRecognizer]; } @@ -128,7 +129,7 @@ - (void)handlePinchGesture:(UIPinchGestureRecognizer *)pinchGestureRecognizer #pragma mark - Overridden Properties -- (UIGestureRecognizer*)gestureRecognizer +- (UIGestureRecognizer *)gestureRecognizer { if ( !_gestureRecognizer ) { _gestureRecognizer = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(handlePinchGesture:)]; diff --git a/RZTransitions/Transitions/RZCardSlideAnimationController.h b/RZTransitions/Transitions/RZCardSlideAnimationController.h index 13960c9..38bc48e 100644 --- a/RZTransitions/Transitions/RZCardSlideAnimationController.h +++ b/RZTransitions/Transitions/RZCardSlideAnimationController.h @@ -48,7 +48,7 @@ @property (assign, nonatomic) BOOL horizontalOrientation; /** - * The background color for the transitions container. + * The background color for the transition's container. * * Default is [UIColor blackColor] */ diff --git a/RZTransitions/Transitions/RZCirclePushAnimationController.h b/RZTransitions/Transitions/RZCirclePushAnimationController.h index 35f4f9b..a2caaea 100644 --- a/RZTransitions/Transitions/RZCirclePushAnimationController.h +++ b/RZTransitions/Transitions/RZCirclePushAnimationController.h @@ -38,19 +38,19 @@ /** * Animation delegate for controlling information about the circle transition. */ -@property (weak, nonatomic) id circleDelegate; +@property (weak, nonatomic) id circleDelegate; /** - * The maximum scale that a circle will get to during the transition. Used in as a transform.scale. + * The maximum scale that a circle will get to during the transition. Used in as a transform.scale. * Default is 2.5. */ -@property (assign, nonatomic) CGFloat maximumCircleScale; +@property (assign, nonatomic) CGFloat maximumCircleScale; /** - * The minimum scale that a circle will get to during the transition. Used in as a transform.scale. + * The minimum scale that a circle will get to during the transition. Used in as a transform.scale. * Default is 0.25. */ -@property (assign, nonatomic) CGFloat minimumCircleScale; +@property (assign, nonatomic) CGFloat minimumCircleScale; @end @@ -72,4 +72,4 @@ */ - (CGFloat)circleStartingRadius; -@end \ No newline at end of file +@end diff --git a/RZTransitions/Transitions/RZRectZoomAnimationController.h b/RZTransitions/Transitions/RZRectZoomAnimationController.h index 943d3eb..b306873 100644 --- a/RZTransitions/Transitions/RZRectZoomAnimationController.h +++ b/RZTransitions/Transitions/RZRectZoomAnimationController.h @@ -38,32 +38,32 @@ /** * The delegate for information about the positioning of the views. */ -@property (weak, nonatomic) id rectZoomDelegate; +@property (weak, nonatomic) id rectZoomDelegate; /** - * Flag to allow the From View controller to fade it's alpha. + * Flag to allow the From View controller to fade its alpha. * Default to YES; */ -@property (assign, nonatomic) BOOL shouldFadeBackgroundViewController; +@property (assign, nonatomic) BOOL shouldFadeBackgroundViewController; /** * Physics animation spring dampening. * Default is 0.6f. */ -@property (assign, nonatomic) CGFloat animationSpringDampening; +@property (assign, nonatomic) CGFloat animationSpringDampening; /** * Physics animation spring velocity. * Default is 15.0f. */ -@property (assign, nonatomic) CGFloat animationSpringVelocity; +@property (assign, nonatomic) CGFloat animationSpringVelocity; @end @protocol RZRectZoomAnimationDelegate /** - * The rect that the ToView will go to. This should be relative to the view controller. + * The rect that the ToView will go to. This should be relative to the view controller. * * @return The rect to insert the ToView into. */ diff --git a/RZTransitions/Transitions/RZTransitionsAnimationControllers.h b/RZTransitions/Transitions/RZTransitionsAnimationControllers.h index d10031c..cd26769 100644 --- a/RZTransitions/Transitions/RZTransitionsAnimationControllers.h +++ b/RZTransitions/Transitions/RZTransitionsAnimationControllers.h @@ -30,7 +30,7 @@ #define RZTransitions_Demo_RZTransitionsAnimationControllers_h /** - * This is general import helper. Saves importing multiple transitions. + * This is general import helper. Saves importing multiple transitions. * TODO: Why?/ Delete for next larger release. */ diff --git a/RZTransitions/Transitions/RZZoomBlurAnimationController.h b/RZTransitions/Transitions/RZZoomBlurAnimationController.h index 79a3d55..658bf6a 100644 --- a/RZTransitions/Transitions/RZZoomBlurAnimationController.h +++ b/RZTransitions/Transitions/RZZoomBlurAnimationController.h @@ -56,6 +56,6 @@ * * Default is [UIColor colorWithWhite:1.0f alpha:0.15f] */ -@property (strong, nonatomic) UIColor* blurTintColor; +@property (strong, nonatomic) UIColor *blurTintColor; @end diff --git a/RZTransitions/Transitions/RZZoomBlurAnimationController.m b/RZTransitions/Transitions/RZZoomBlurAnimationController.m index 05936f1..39cde6c 100644 --- a/RZTransitions/Transitions/RZZoomBlurAnimationController.m +++ b/RZTransitions/Transitions/RZZoomBlurAnimationController.m @@ -43,7 +43,8 @@ @implementation RZZoomBlurAnimationController @synthesize isPositiveAnimation = _isPositiveAnimation; -- (instancetype)init { +- (instancetype)init +{ self = [super init]; if ( self ) { _blurRadius = kRZZBDefaultBlurRadius; diff --git a/RZTransitions/Transitions/RZZoomPushAnimationController.m b/RZTransitions/Transitions/RZZoomPushAnimationController.m index 908063f..b307c23 100644 --- a/RZTransitions/Transitions/RZZoomPushAnimationController.m +++ b/RZTransitions/Transitions/RZZoomPushAnimationController.m @@ -46,7 +46,7 @@ - (void)animateTransition:(id)transitionCo [container insertSubview:toViewController.view belowSubview:fromViewController.view]; toViewController.view.transform = CGAffineTransformMakeScale(1.0 - kRZPushScaleChangePct, 1.0 - kRZPushScaleChangePct); - //! TODO: We shouldn't really call viewWillAppear here.. + //! TODO: We shouldn't really call viewWillAppear here. [toViewController viewWillAppear:YES]; [UIView animateWithDuration:kRZPushTransitionTime delay:0 diff --git a/RZTransitions/Utilities/UIImage+RZTransitionsFastImageBlur.h b/RZTransitions/Utilities/UIImage+RZTransitionsFastImageBlur.h index 5e32250..9205fd0 100644 --- a/RZTransitions/Utilities/UIImage+RZTransitionsFastImageBlur.h +++ b/RZTransitions/Utilities/UIImage+RZTransitionsFastImageBlur.h @@ -112,11 +112,11 @@ * * @param view The view to be blured * @param blurRadius The radius of the blur - * @param tintColor A color to tint the blur. Only applies if the blur radius is not zero. + * @param tintColor A color to tint the blur. Only applies if the blur radius is not zero. * @param saturationDeltaFactor The saturation delta that should be applied to the blur. * * @return A UIImage used for the view pass */ -+ (UIImage *)blurredImageByCapturingView:(UIView*)view withRadius:(CGFloat)blurRadius tintColor:(UIColor*)tintColor saturationDeltaFactor:(CGFloat)saturationDeltaFactor; ++ (UIImage *)blurredImageByCapturingView:(UIView *)view withRadius:(CGFloat)blurRadius tintColor:(UIColor *)tintColor saturationDeltaFactor:(CGFloat)saturationDeltaFactor; @end diff --git a/RZTransitions/Utilities/UIImage+RZTransitionsSnapshotHelpers.h b/RZTransitions/Utilities/UIImage+RZTransitionsSnapshotHelpers.h index 0a2b046..5076821 100644 --- a/RZTransitions/Utilities/UIImage+RZTransitionsSnapshotHelpers.h +++ b/RZTransitions/Utilities/UIImage+RZTransitionsSnapshotHelpers.h @@ -37,8 +37,8 @@ * @param view The view to be captured * @param waitForUpdate Flag to see if the screen should update before capturing the view * - * @return The Image from the view. + * @return The image from the view. */ -+ (UIImage *)imageByCapturingView:(UIView*)view afterScreenUpdate:(BOOL)waitForUpdate; ++ (UIImage *)imageByCapturingView:(UIView *)view afterScreenUpdate:(BOOL)waitForUpdate; @end diff --git a/RZTransitions/Utilities/UIImage+RZTransitionsSnapshotHelpers.m b/RZTransitions/Utilities/UIImage+RZTransitionsSnapshotHelpers.m index 0b65643..f8866b4 100644 --- a/RZTransitions/Utilities/UIImage+RZTransitionsSnapshotHelpers.m +++ b/RZTransitions/Utilities/UIImage+RZTransitionsSnapshotHelpers.m @@ -30,11 +30,11 @@ @implementation UIImage (RZTransitionsSnapshotHelpers) -+ (UIImage *)imageByCapturingView:(UIView*)view afterScreenUpdate:(BOOL)waitForUpdate ++ (UIImage *)imageByCapturingView:(UIView *)view afterScreenUpdate:(BOOL)waitForUpdate { UIImage *outputImage = nil; CGRect imageRect = CGRectMake(0, 0, CGRectGetWidth(view.bounds), CGRectGetHeight(view.bounds)); - UIGraphicsBeginImageContextWithOptions(imageRect.size, NO, 0.0); + UIGraphicsBeginImageContextWithOptions(imageRect.size, NO, 0.0f); BOOL success = [view drawViewHierarchyInRect:view.bounds afterScreenUpdates:waitForUpdate]; if ( success ) { @@ -44,7 +44,6 @@ + (UIImage *)imageByCapturingView:(UIView*)view afterScreenUpdate:(BOOL)waitForU UIGraphicsEndImageContext(); return outputImage; - } @end From 215812f1fc67f7d6d8de07f7b785e11841011f4a Mon Sep 17 00:00:00 2001 From: Zev Eisenberg Date: Thu, 9 Apr 2015 19:49:29 -0400 Subject: [PATCH 7/9] Replace fabsf with fabs to fix Xcode 6.3 warning. --- RZTransitions/Interactors/RZHorizontalInteractionController.m | 2 +- .../Interactors/RZVerticalSwipeInteractionController.m | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/RZTransitions/Interactors/RZHorizontalInteractionController.m b/RZTransitions/Interactors/RZHorizontalInteractionController.m index f6bda5a..46543cf 100644 --- a/RZTransitions/Interactors/RZHorizontalInteractionController.m +++ b/RZTransitions/Interactors/RZHorizontalInteractionController.m @@ -44,7 +44,7 @@ - (CGFloat)swipeCompletionPercent - (CGFloat)translationPercentageWithPanGestureRecongizer:(UIPanGestureRecognizer *)panGestureRecognizer { - return fabsf([self translationWithPanGestureRecongizer:panGestureRecognizer] / panGestureRecognizer.view.bounds.size.width); + return fabs([self translationWithPanGestureRecongizer:panGestureRecognizer] / panGestureRecognizer.view.bounds.size.width); } - (CGFloat)translationWithPanGestureRecongizer:(UIPanGestureRecognizer *)panGestureRecognizer diff --git a/RZTransitions/Interactors/RZVerticalSwipeInteractionController.m b/RZTransitions/Interactors/RZVerticalSwipeInteractionController.m index 28bcb06..2f6e611 100644 --- a/RZTransitions/Interactors/RZVerticalSwipeInteractionController.m +++ b/RZTransitions/Interactors/RZVerticalSwipeInteractionController.m @@ -44,7 +44,7 @@ - (CGFloat)swipeCompletionPercent - (CGFloat)translationPercentageWithPanGestureRecongizer:(UIPanGestureRecognizer *)panGestureRecognizer { - return fabsf([self translationWithPanGestureRecongizer:panGestureRecognizer] / panGestureRecognizer.view.bounds.size.height); + return fabs([self translationWithPanGestureRecongizer:panGestureRecognizer] / panGestureRecognizer.view.bounds.size.height); } - (CGFloat)translationWithPanGestureRecongizer:(UIPanGestureRecognizer *)panGestureRecognizer From 91831490d4ee1eaf149c0eb2dac3ddd26923c9b7 Mon Sep 17 00:00:00 2001 From: Alex Rouse Date: Thu, 23 Apr 2015 11:21:59 -0400 Subject: [PATCH 8/9] Adding Maintainers to the repo. --- README.md | 38 +++++++++++++++++--------------------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 0ad5b72..f41ad05 100644 --- a/README.md +++ b/README.md @@ -99,26 +99,22 @@ UINavigationController *navigationController = [[UINavigationController alloc] i You can use any of the animation controllers or interaction controllers without the RZTransitionsManager and simply use them with the iOS7 custom View Controller transition APIs. +## Maintainers + +[arrouse](https://github.com/arrouse) ([@arrouse88](http://twitter.com/arrouse88)) + +[nbonatsakis](https://github.com/nbonatsakis) ([@nickbona](http://twitter.com/nickbona)) + +[dostrander](https://github.com/dostrander) ([@_Derko](http://twitter.com/_Derko)) + +[markpragma](https://github.com/markpragma) ([@markpragma ](http://twitter.com/markpragma)) + +[rztakashi](https://github.com/rztakashi) + +## Contributors + +[smbarne](https://github.com/smbarne) ([@smbarne](http://twitter.com/smbarne)) + ## License -RZTransitions is distributed under an [MIT License](http://opensource.org/licenses/MIT). See the LICENSE file for more details. -``` -Copyright (c) 2014 Raizlabs and other contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -``` +RZTransitions is licensed under the MIT license. See the `LICENSE` file for details. From dc0eb5578ee14325f41a1e754eed03efdf6245cc Mon Sep 17 00:00:00 2001 From: mr-fixit Date: Tue, 17 Nov 2015 11:20:30 -0500 Subject: [PATCH 9/9] Update UIImage+RZTransitionsFastImageBlur.h --- RZTransitions/Utilities/UIImage+RZTransitionsFastImageBlur.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RZTransitions/Utilities/UIImage+RZTransitionsFastImageBlur.h b/RZTransitions/Utilities/UIImage+RZTransitionsFastImageBlur.h index 9ebff5e..d628016 100644 --- a/RZTransitions/Utilities/UIImage+RZTransitionsFastImageBlur.h +++ b/RZTransitions/Utilities/UIImage+RZTransitionsFastImageBlur.h @@ -108,7 +108,7 @@ // tint color ONLY APPLIES when blurring radius is non-negligible /** - * gets an image from a view and blurs it using a modification on Apple's bluring code to speed it up. + * gets an image from a view and blurs it using a modification on Apple's blurring code to speed it up. * * @param view The view to be blured * @param blurRadius The radius of the blur