Skip to content

Instantly share code, notes, and snippets.

@jollyjoester
Created April 8, 2014 07:47
Show Gist options
  • Save jollyjoester/10100174 to your computer and use it in GitHub Desktop.
Save jollyjoester/10100174 to your computer and use it in GitHub Desktop.
Show/Hide animation
@property (weak, nonatomic) IBOutlet UIWebView *webView;
...
- (void)showWebView{
// アニメーションでWebViewを表示させる
void (^animations)(void) = ^{
self.webView.alpha = 1.0;
};
self.webView.alpha = 0.0;
self.webView.hidden = NO;
[UIView animateWithDuration:0.5 animations:animations completion:nil];
}
- (void) hideView {
// アニメーションでWebViewを非表示にする
void (^animations)(void) = ^{
self.webView.alpha = 0.0;
};
void (^completionAnimation)(BOOL) = ^(BOOL finished) {
self.webView.hidden = NO;
};
[UIView animateWithDuration:0.5 animations:animations completion:completionAnimation];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment