/*
= = = Gesture =====
One
1, Uiswipegesturerecognizer instantiation of a gesture initwithtarget
2. Set gesture Slide direction
3. Self.view Add this gesture instance
4. Adding events
Two
Tap
UITapGestureRecognizer
. Numberoftouchesrequire Number of fingers
. Numberoftapsrequire Hits
[Requiregesturerecognizertofail:] event conflict execution which one
1 2Uiswipegesturerecognizer *leftswipe =[[Uiswipegesturerecognizer alloc]initwithtarget:self Action: @selector (Leftswipeaction)];3 [Leftswipe Setdirection:uiswipegesturerecognizerdirectionleft];4 //[Self.view addgesturerecognizer:leftswipe];5 [Self.imageviewdemao addgesturerecognizer:leftswipe];6 7UITapGestureRecognizer *tapgesture =[[UITapGestureRecognizer alloc]initwithtarget:self Action: @selector (Tapaction)];8tapgesture.numberoftouchesrequired =1;9tapgesture.numberoftapsrequired =1;Ten [Self.imageviewdemao addgesturerecognizer:tapgesture]; One A -UITapGestureRecognizer *tapgesture2 =[[UITapGestureRecognizer alloc]initwithtarget:self Action: @selector (TapAction2)]; -tapgesture2.numberoftouchesrequired =1; thetapgesture2.numberoftapsrequired =2; - [Self.imageviewdemao Addgesturerecognizer:tapgesture2]; - - //Uigesturerecognizer Resolving the event overlap process +[Tapgesture Requiregesturerecognizertofail:tapgesture2];
= = = Simple Animation (gesture event) = = =
---------One,
1. Animation starts
[UIView beginanimations:]
2. Animation settings
Setanimationduration time
Setanimationtransition
3. Animation submission
[UIView Commitanimations]
-------Second,
Catransition (differs from catransaction)
1. Instantiate an animation
2,. Type
. Subtype
3, [Self.view.layer Addanimation:forkey:]
*/
1Catransition *animation =[catransition animation];2Animation.type =@"Cube";3Animation.subtype =Kcatransitionfromright;4[Self.imageViewDemao.layer addanimation:animation Forkey:@" Left"];5SELF.I + +;6 if(Self.i >3)7 {8SELF.I =1;9 }Ten //Self.view.backgroundColor = [Uicolor colorwithpatternimage:[uiimage imagenamed:[nsstring stringwithformat:@ "%d" , SELF.I]]; OneSelf.imageViewDemao.image = [UIImage imagenamed:[nsstring stringWithFormat:@"%d", SELF.I]]; A - - /* theType - ade//Crossfade Transitions (transition direction not supported) - Push//New view roll out the old view - Movein//New view above the old view + reveal//move the old view away to show the new view below - cube//Cube Rollover effect-this works well + oglflip//Upper and lower left and right rollover effect A suckeffect//shrinkage effect, such as a piece of cloth is pumped away (not support transition direction) at rippleeffect//Drip effect (transition direction not supported) - Pagecurl//Page UP effect - pageuncurl//Page DOWN effect - Camerairishollowopen//Camera lens open effect (transition direction not supported) - camerairishollowclose//Camera lens Close effect (no transition direction is supported) - in */
iOS Animate simple animation experience