Last active
July 29, 2016 17:42
-
-
Save jormungand/34d9f8d722f095a3bea96db8d22ad50f to your computer and use it in GitHub Desktop.
animates center movement correctly
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (IBAction)addInsets:(id)sender | |
{ | |
[UIView animateWithDuration:0.3 animations:^{ | |
self.topLayoutGuide.length = self.topLayoutGuide.length > 0.0 ? 0.0 : 100.0; | |
[self.map setNeedsLayout]; | |
[self.map layoutIfNeeded]; | |
[self.map setCenterCoordinate:self.map.userLocation.coordinate animated:YES]; | |
} completion:^(BOOL finished) { | |
// did finish inset + center animation | |
}]; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment