Created
April 8, 2014 07:47
-
-
Save jollyjoester/10100174 to your computer and use it in GitHub Desktop.
Show/Hide animation
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
| @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