Nonsense not much to say on the code we're going to create a Uiviewcontroller
typedef Enum:nsuinteger {
Fade = 1,//fade in
Push,//push
Reveal,//Uncover
Movein,//cover
Cube,//Cube
Suckeffect,//Suck
Oglflip,//Flip
Rippleeffect,//Ripple
Pagecurl,//page
Pageuncurl,//Reverse page
Camerairishollowopen,//Open lens
Camerairishollowclose,//Turn off the lens
Curldown,//Page Down
Curlup,//PAGE UP
Flipfromleft,//left Flip
Flipfromright,//Right Flip
} Animationtype;
Various paging effects.
@interface Viewcontroller () {
Nsinteger _count;//turn to the first few pages
Total number of Nsinteger _sum;//pages
Nsarray *_arr;//Set Page background color
}
-(void) Viewdidload {
[Super Viewdidload];
_sum = 20;
Self.view.backgroundColor = [Uicolor Whitecolor];
_arr = @[[uicolor redcolor],[uicolor greencolor],[uicolor Bluecolor]];
NSLog (@ "------------------?------------page%ld", (long) _count);
[Self rootviewadduiswipegesturerecognizer];
}
-(void) rootviewadduiswipegesturerecognizer{
Uiswipegesturerecognizer *FROMRIGHTSWIP = [[Uiswipegesturerecognizer alloc] initwithtarget:self action: @selector ( NextPage)];
Fromrightswip.direction = Uiswipegesturerecognizerdirectionleft;
[Self.view ADDGESTURERECOGNIZER:FROMRIGHTSWIP];
Uiswipegesturerecognizer *FROMLEFTSWIP = [[Uiswipegesturerecognizer alloc] initwithtarget:self action: @selector ( Forwardpage)];
Fromleftswip.direction = Uiswipegesturerecognizerdirectionright;
[Self.view ADDGESTURERECOGNIZER:FROMLEFTSWIP];
}
Implementing Sliding Events
-(void) nextpage{
Self.view.backgroundColor = _arr[arc4random ()%3];
if (_count<_sum-1) {
NSString *subtypestring;
subtypestring = Kcatransitionfromright;
[Self transitionwithtype:@ "push" withsubtype:subtypestring ForView:self.view];
_count = _count + 1;
} else {
_count = _sum-1;
}
NSLog (@ "+++++++++++++++++++?+++++++++++++++ page%ld", (long) _count);
}
-(void) forwardpage{
Self.view.backgroundColor = _arr[arc4random ()%3];
if (_count>0) {
NSString *subtypestring;
subtypestring = Kcatransitionfromleft;
[Self transitionwithtype:@ "push" withsubtype:subtypestring ForView:self.view];
_count = _count-1;
} else {
_count = 0;
}
NSLog (@ "------------------?------------page%ld", (long) _count);
}
#pragma mark Catransition Animation implementation
/**
* Animation effect implementation
*/
-(void) Transitionwithtype: (NSString *) type Withsubtype: (NSString *) subtype Forview: (UIView *) Rootview {
Creating Catransition Objects
Catransition *animation = [catransition animation];
Animation.duration = 0.5f;
Animation.type = type;
if (subtype!= nil) {
Animation.subtype = subtype;
}
Animation.timingfunction = Uiviewanimationoptioncurveeaseinout;
[Rootview.layer addanimation:animation forkey:@ "animation"];
}
-(void) didreceivememorywarning {
[Super didreceivememorywarning];
}