Last active
August 29, 2015 13:57
-
-
Save wtsnz/9480903 to your computer and use it in GitHub Desktop.
Implementing Animated:(BOOL)animated
This file contains hidden or 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
- (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