Skip to content

Instantly share code, notes, and snippets.

@jormungand
Last active July 29, 2016 17:42
Show Gist options
  • Save jormungand/34d9f8d722f095a3bea96db8d22ad50f to your computer and use it in GitHub Desktop.
Save jormungand/34d9f8d722f095a3bea96db8d22ad50f to your computer and use it in GitHub Desktop.
animates center movement correctly
- (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