Skip to content

Instantly share code, notes, and snippets.

@JoelJWest
Created June 16, 2016 19:58
Show Gist options
  • Save JoelJWest/fce509189bd28fdafd8d2a4b973acc15 to your computer and use it in GitHub Desktop.
Save JoelJWest/fce509189bd28fdafd8d2a4b973acc15 to your computer and use it in GitHub Desktop.
- (void)viewWillTransitionToSize:(CGSize)size
withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator {
NSUInteger currentAccountIndex = self.currentAccountIndex;
[super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
[coordinator animateAlongsideTransition:nil
completion:^ (id<UIViewControllerTransitionCoordinatorContext> context) {
self.currentAccountIndex = currentAccountIndex;
self.accountsCollectionView.contentOffset = CGPointMake(self.accountsCollectionView.width * currentAccountIndex, 0.f);
}];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment