Skip to content

Commit eed31e1

Browse files
committed
Fixes ECSlidingViewController#219. Delay rotation until after transition completes
1 parent 5e1f007 commit eed31e1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ECSlidingViewController/ECSlidingViewController.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,10 @@ - (void)viewDidLayoutSubviews {
193193
}
194194
}
195195

196+
- (BOOL)shouldAutorotate {
197+
return self.currentOperation == ECSlidingViewControllerOperationNone;
198+
}
199+
196200
- (BOOL)shouldAutomaticallyForwardAppearanceMethods {
197201
return NO;
198202
}
@@ -841,6 +845,7 @@ - (void)completeTransition:(BOOL)didComplete {
841845
self.currentAnimationPercentage = 0;
842846
self.currentOperation = ECSlidingViewControllerOperationNone;
843847
self.transitionInProgress = NO;
848+
[UIViewController attemptRotationToDeviceOrientation];
844849
}
845850

846851
- (UIViewController *)viewControllerForKey:(NSString *)key {

0 commit comments

Comments
 (0)