I am creating an ePub reader, which reads ePub files. I want to implement a page slide effect similar to a physical book. For example.
What animation is this? This doesn’t work:
- (void)loadPage{
[UIView beginAnimations:nil context:nil];
//change to set the time
[UIView setAnimationDuration:1];
[UIView setAnimationBeginsFromCurrentState:YES];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.view cache:YES];
// do your view swapping here
[UIView commitAnimations];
}
on swipe:
- (void)swipeRightAction:(id)ignored
{
NSLog(@"Swipe Right");
if (_pageNumber>0) {
_pageNumber--;
[self loadPage];
}
}
- (void)swipeLeftAction:(id)ignored
{
NSLog(@"Swipe Left");
if ([self._ePubContent._spine count]-1>_pageNumber) {
_pageNumber++;
[self loadPage];
}
}
I have done the same with third party api. You can take refrence from below URL
https://github.com/jemmons/PageCurl
https://github.com/xissburg/XBPageCurl
https://github.com/brow/leaves