Search code examples
iphoneiospdfuiwebviewpdf-reader

How to give page curl animation in webView?


I am working on PDF Reader application. if i display pdf file then i am not able to change font size of this.

So i display ePub file in UIWebView. But my problem is how to add page curl animation in UIWebView like iBook and kindle apps does.


Solution

  • I have created a UIWebView named myWebView and on clicking the button the curl effect will be shown on the webview:-

        -(IBAction) nextPageAnimationForWebView{        
        CATransition *animation = [CATransition animation];
        [animation setDelegate:self];
        [animation setDuration:1.0f];
        animation.startProgress = 0.5;
        animation.endProgress   = 1;
        [animation setTimingFunction:UIViewAnimationCurveEaseInOut];
        [animation setType:@"pageCurl"];
    
            //[animation setType:kcat]; 
            [animation setSubtype:kCATransitionMoveIn];
    
        [animation setRemovedOnCompletion:NO];
        [animation setFillMode: @"extended"];
        [animation setRemovedOnCompletion: NO];
        [[myWebView layer] addAnimation:animation forKey:@"WebPageCurl"]; 
    
    }
    

    Please tell if this solved your answer.