From 2ee51d29eb40eda9b4188b14e433f1c9fb84950e Mon Sep 17 00:00:00 2001 From: Jeff Kunzelman Date: Tue, 15 Mar 2016 12:09:15 -0700 Subject: [PATCH] added method to handle rotation and reset animation geometry --- .../TLContainmentViewController.m | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/UIKit-Dynamics-Example/TLContainmentViewController.m b/UIKit-Dynamics-Example/TLContainmentViewController.m index ec3f257..a55ca7e 100644 --- a/UIKit-Dynamics-Example/TLContainmentViewController.m +++ b/UIKit-Dynamics-Example/TLContainmentViewController.m @@ -89,6 +89,20 @@ - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { contentViewController.delegate = self; } } +#pragma mark - Handle Rotation +- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id)coordinator +{ + [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator]; + self.animator = nil; + self.menuOpen = NO; + [coordinator animateAlongsideTransition:^(id context) { + // Place code here to perform animations during the rotation. + // You can pass nil or leave this block empty if not necessary. + + } completion:^(id context) { + [self setupMapContainerViewAnimatorProperties]; + }]; +} #pragma mark - UIGestureRecognizerDelegate Methods