Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion EMPageViewController/EMPageViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ open class EMPageViewController: UIViewController, UIScrollViewDelegate {
/// The direction the page controller is scrolling towards.
open private(set) var navigationDirection: EMPageViewControllerNavigationDirection?

private var adjustingContentOffset = false // Flag used to prevent isScrolling delegate when shifting scrollView
public var adjustingContentOffset = false // Flag used to prevent isScrolling delegate when shifting scrollView
private var loadNewAdjoiningViewControllersOnFinish = false
private var didFinishScrollingCompletionHandler: ((_ transitionSuccessful: Bool) -> Void)?
private var transitionAnimated = false // Used for accurate view appearance messages
Expand Down
21 changes: 21 additions & 0 deletions Examples/Greetings-ObjC/Greetings-ObjC/RootViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -188,5 +188,26 @@ - (void)em_pageViewController:(EMPageViewController *)pageViewController didFini

}

- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id <UIViewControllerTransitionCoordinator>)coordinator {
[super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
// Code here will execute before the rotation begins.
// Equivalent to placing it in the deprecated method -[willRotateToInterfaceOrientation:duration:]

// Disable scrolling in our swipe navigation to prevent layout issues.
[self.pageViewController.scrollView setScrollEnabled:NO];
self.pageViewController.adjustingContentOffset = YES;
NSLog(@"ROTATING WILL START");
[coordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext> context) {

} completion:^(id<UIViewControllerTransitionCoordinatorContext> context) {
// Code here will execute after the rotation has finished.
// Equivalent to placing it in the deprecated method -[didRotateFromInterfaceOrientation:]

// Enable scrolling once rotating finishes so we can use swipe navigation.
[self.pageViewController.scrollView setScrollEnabled:YES];
self.pageViewController.adjustingContentOffset = NO;
NSLog(@"ROTATING FINISHED ");
}];
}

@end