I have a swipe gesture that changes the pages between ePub/PDF pages instantly. It uses a UIWebView to display the pages and [_webview loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:_pagesPath]]]
to change the page. I have no where to begin to implement it so that it will gradually swipe between pages instead of instant.
Are there any tutorials anywhere? Or if someone could ex开发者_如何学编程plain the basic theory / which view controllers to use etc? I'd be very grateful.
Side note: I'm very new (as in I started learning obective-c a couple of days ago) to iOS development. I have a very strong background in OO PHP and client side web technologies.
I downloaded a pretty good ePub reader app and have stripped it down and rebuilt it to understand how it works and to teach myself objective-c quicker. So far so good, just made some changes so it'll accept PDFs as well and put in the swipe gestures.
Regards, Kieran
You really shouldn't use UIWebView for pf rendering - it's slow and not really customizable. Apple has introduced QuickLook in iOS4 as a better alternative, but it's also quite slow and static. If you need something fast, you hace to do it yourself, with Quartz and the CGPDF* API.
For the swipe gesture, what you want is a UIScrollView with paging enabled, that's much better than static sliding and lets you drag the pages fluidly. You also may need to reuse the views inside the UIScrollView for better performance.
精彩评论