Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- How to update UIWebView during an animation?
- - (IBAction)flipWebViewGestureRecognizer:(id)sender
- {
- // isFrontView is boolean to determine if card is front or back
- if(self.isFrontOfView)
- {
- self.isFrontOfView = NO;
- [UIView transitionWithView: self.imageView
- duration: 1.0
- options: UIViewAnimationOptionTransitionFlipFromTop
- animations: ^{ [self loadBack]; }
- completion: nil];
- }
- else
- {
- self.isFrontOfView = YES;
- [UIView transitionWithView: self.imageView
- duration: 1.0
- options: UIViewAnimationOptionTransitionFlipFromTop
- animations: ^{ [self loadFront]; }
- completion: nil];
- }
- }
- - (void) loadFront
- {
- NSString *html = @"<p>Front Of Card</p>";
- [self.viewWebView loadHTMLString:html baseURL:nil];
- }
- - (void) loadBack
- {
- NSString *html = @"<p>Front Of Card</p> <br /> <p>as well as back of card<p>";
- [self.viewWebView loadHTMLString:html baseURL:nil];
- }
Add Comment
Please, Sign In to add comment