Skip to content

Instantly share code, notes, and snippets.

@IvanovDeveloper
Created July 11, 2016 14:39
Show Gist options
  • Select an option

  • Save IvanovDeveloper/b46f745ca2e0993dd7a5701a9cb64609 to your computer and use it in GitHub Desktop.

Select an option

Save IvanovDeveloper/b46f745ca2e0993dd7a5701a9cb64609 to your computer and use it in GitHub Desktop.
Как определить момент до поворота экрана и после поворота экрана
- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id <UIViewControllerTransitionCoordinator>)coordinator
{
[super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
[coordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext> context) {
// Stuff you used to do in willRotateToInterfaceOrientation would go here.
// If you don't need anything special, you can set this block to nil.
} completion:^(id<UIViewControllerTransitionCoordinatorContext> context) {
// Stuff you used to do in didRotateFromInterfaceOrientation would go here.
// If not needed, set to nil.
}];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment