屏幕旋转前后方向的获取
- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator {
[super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
//屏幕旋转前的方向
UIInterfaceOrientation beforeTransition = [UIApplication sharedApplication].statusBarOrientation;
[coordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext> _Nonnull context) {
//屏幕旋转后的方向
UIInterfaceOrientation afterTransition = [UIApplication sharedApplication].statusBarOrientation;
} completion:^(id<UIViewControllerTransitionCoordinatorContext> _Nonnull context) {
}];
}