Skip to content

Instantly share code, notes, and snippets.

@wtsnz
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wtsnz/9480903 to your computer and use it in GitHub Desktop.
Save wtsnz/9480903 to your computer and use it in GitHub Desktop.
Implementing Animated:(BOOL)animated
- (void)hideAdBannerViewAnimated:(BOOL)animated
{
void (^animations)() = ^void() {
CGRect addBannerViewFrame = self.adBannerView.frame;
addBannerViewFrame.origin.y = self.view.frame.size.height;
self.adBannerView.frame = addBannerViewFrame;
};
if (animated) {
[UIView animateWithDuration:0.3 delay:0.0 usingSpringWithDamping:1.0 initialSpringVelocity:1.0 options:UIViewAnimationOptionCurveEaseInOut animations:animations completion:nil];
} else {
animations();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment