Skip to content

Commit

Permalink
Merge pull request #49 from Raizlabs/develop
Browse files Browse the repository at this point in the history
Update master for 1.2.1 release
  • Loading branch information
bskinner committed Feb 4, 2016
2 parents 95b0cb2 + 644ded5 commit c5f3937
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 24 deletions.
4 changes: 2 additions & 2 deletions RZTransitions.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "RZTransitions"
s.version = "1.2"
s.version = "1.2.1"
s.summary = "RZTransitions is a library to help make iOS7 custom View Controller transitions slick and simple."

s.description = <<-DESC
Expand All @@ -19,7 +19,7 @@ Pod::Spec.new do |s|
s.social_media_url = "http://twitter.com/raizlabs"

s.platform = :ios, "7.0"
s.source = { :git => "https://github.com/Raizlabs/RZTransitions.git", :tag => "1.2" }
s.source = { :git => "https://github.com/Raizlabs/RZTransitions.git", :tag => "1.2.1" }
s.source_files = "RZTransitions/**/*.{h,m,swift}"
s.frameworks = "CoreGraphics", "UIKit", "Foundation"
s.requires_arc = true
Expand Down
29 changes: 11 additions & 18 deletions RZTransitions/Interactors/RZBaseSwipeInteractionController.m
Original file line number Diff line number Diff line change
Expand Up @@ -90,42 +90,35 @@ - (void)handlePanGesture:(UIPanGestureRecognizer *)panGestureRecognizer
}
}
else {
if ( self.action & RZTransitionAction_Pop ) {
[self cancelInteractiveTransition];
self.isInteractive = NO;
if (self.action & RZTransitionAction_Pop) {
[self.fromViewController.navigationController popViewControllerAnimated:YES];
}
else if ( self.action & RZTransitionAction_Dismiss ) {
[self cancelInteractiveTransition];
self.isInteractive = NO;
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;

case UIGestureRecognizerStateCancelled:
self.isInteractive = NO;
[self cancelInteractiveTransition];
break;

case UIGestureRecognizerStateEnded:
if ( self.isInteractive ) {
self.isInteractive = NO;
if ( !self.shouldCompleteTransition || panGestureRecognizer.state == UIGestureRecognizerStateCancelled ) {
if (self.isInteractive) {
if (!self.shouldCompleteTransition) {
[self cancelInteractiveTransition];
}
else {
[self finishInteractiveTransition];
}

self.isInteractive = NO;
}

default:
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

@protocol RZCirclePushAnimationDelegate;

@interface RZCirclePushAnimationController : RZZoomPushAnimationController <RZAnimationControllerProtocol>
@interface RZCirclePushAnimationController : RZZoomPushAnimationController

/**
* Animation delegate for controlling information about the circle transition.
Expand Down
21 changes: 19 additions & 2 deletions RZTransitions/Transitions/RZCirclePushAnimationController.m
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@

@interface RZCirclePushAnimationController ()

@property (weak, nonatomic) UIView *maskedView;

- (CGPoint)circleCenterPointWithFromView:(UIView *)fromView;
- (CGFloat)circleStartingRadiusWithFromView:(UIView *)fromView toView:(UIView *)toView;

Expand All @@ -60,6 +62,8 @@ - (instancetype)init

- (void)animateTransition:(id<UIViewControllerContextTransitioning>)transitionContext
{
[super animateTransition:transitionContext];

UIView *fromView = [(NSObject *)transitionContext rzt_fromView];
UIView *toView = [(NSObject *)transitionContext rzt_toView];

Expand Down Expand Up @@ -96,6 +100,7 @@ - (void)animateTransition:(id<UIViewControllerContextTransitioning>)transitionCo
toView.layer.mask = circleMaskLayer;
toView.layer.masksToBounds = YES;
[circleMaskLayer addAnimation:circleMaskAnimation forKey:kRZCircleMaskAnimation];
self.maskedView = toView;
}
else {
[circleMaskAnimation setFillMode:kCAFillModeForwards];
Expand All @@ -108,9 +113,21 @@ - (void)animateTransition:(id<UIViewControllerContextTransitioning>)transitionCo
fromView.layer.mask = circleMaskLayer;
fromView.layer.masksToBounds = YES;
[circleMaskLayer addAnimation:circleMaskAnimation forKey:kRZCircleMaskAnimation];
self.maskedView = fromView;
}

[super animateTransition:transitionContext];
}

- (void)animationEnded:(BOOL)transitionCompleted
{
// animationEnded: is a optional method of the UIViewControllerAnimatedTransitioning protocol.
// RZZoomPushAnimationController does not currently implement this method, but might at some point,
// so make sure we are doing something sane here.
if ([[[self class] superclass] respondsToSelector:@selector(animationEnded:)]) {
[super animationEnded:transitionCompleted];
}

self.maskedView.layer.mask = nil;
self.maskedView = nil;
}

#pragma mark - Helper Methods
Expand Down
2 changes: 1 addition & 1 deletion RZTransitions/Transitions/RZZoomPushAnimationController.m
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ - (void)animateTransition:(id<UIViewControllerContextTransitioning>)transitionCo
}];
}
else {
if (transitionContext.presentationStyle == UIModalPresentationNone) {
if (transitionContext.presentationStyle == UIModalPresentationNone || transitionContext.presentationStyle == UIModalPresentationFullScreen) {
[container insertSubview:toView belowSubview:fromView];
}
toView.transform = CGAffineTransformMakeScale(1.0 + kRZPushScaleChangePct, 1.0 + kRZPushScaleChangePct);
Expand Down

0 comments on commit c5f3937

Please sign in to comment.