Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion ZFDragableModalTransition/ZFModalTransitionAnimator.m
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,9 @@ - (void)orientationChanged:(NSNotification *)notification
{
UIViewController *backViewController = self.modalController.presentingViewController;
backViewController.view.transform = CGAffineTransformIdentity;
backViewController.view.frame = self.modalController.view.bounds;
CGRect bounds = self.modalController.view.bounds;
bounds.origin = CGPointZero;
backViewController.view.frame = bounds;
backViewController.view.transform = CGAffineTransformScale(backViewController.view.transform, self.behindViewScale, self.behindViewScale);
}

Expand Down Expand Up @@ -541,6 +543,13 @@ - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
}

CGFloat topVerticalOffset = -self.scrollview.contentInset.top;
// @available is for Xcode 9+. Can remove this if statement if not using
// Xcode 9+.
if (@available(iOS 11, *)) {
if ([self.scrollview respondsToSelector:@selector(safeAreaInsets)]) {
topVerticalOffset -= self.scrollview.safeAreaInsets.top;
}
}

if ((fabs(velocity.x) < fabs(velocity.y)) && (nowPoint.y > prevPoint.y) && (self.scrollview.contentOffset.y <= topVerticalOffset)) {
self.isFail = @NO;
Expand Down