Dynamic Effect settings for switching between views:
Settingscontroller * settings = [[settingscontroller alloc] initwithnibname: @ "settingsview" Bundle: Nil];
Settings. modaltransitionstyle = uimodaltransitionstyleflIphorizontal;// Horizontal flip
[Self presentmodalviewcontrollEr: settings animated: Yes];
[Settings release];
-(Ibaction) Activate :( uiview *) view
{
Cgcontextref context =
Uigraphicsgetcurrentcontext ();
[Uiview
Beginanimations: nilcontext: Context];
[Uiview
Setanimationcurve: uiviewanimationcurveeaseinout];
[Uiview
Setanimationduration: const_animation_time];
[View setcenter: uppointofview (View)];
Cabasicanimation * scalinganimation = (cabasicanimation *) [view. layeranimationforkey: @ "Scaling"];
If (! Scalinganimation)
{
Scalinganimation = [cabasicanimationanimationwithkeypath: @ "transform"];
Scalinganimation. repeatcount = 1;
Scalinganimation. Duration = const_animation_time;
Scalinganimation. autoreverses = no;
Scalinganimation. timingfunction = [camediatimingfunctionfunctionwithname: kcamediatimingfunctioneaseout];
Scalinganimation. fromvalue = [nsvaluevaluewithcatransform3d: catransform3dmakescale (1.0, 1.0,
(1.0)];
Scalinganimation. tovalue = [nsvaluevaluewithcatransform3d: catransform3dmakescale (const_enlarge_proportion, const_enlarge_proportion,
(1.0)];
}
[View. layer addanimation: scalinganimationforkey: @ "Scaling"];
View. layer. Transform = catransform3dmakescale (const_enlarge_proportion, const_enlarge_proportion,
1.0 );
[Uiview
Commitanimations];
}
-(Ibaction) deactivate :( uiview *) view
{
Cgcontextref context =
Uigraphicsgetcurrentcontext ();
[Uiview
Beginanimations: nilcontext: Context];
[Uiview
Setanimationcurve: uiviewanimationcurveeaseinout];
[Uiview
Setanimationduration: const_animation_time];
[View setcenter: downpointofview (View)];
Cabasicanimation * scalinganimation = (cabasicanimation *) [view. layeranimationforkey: @ "descaling"];
If (! Scalinganimation)
{
Scalinganimation = [cabasicanimationanimationwithkeypath: @ "transform"];
Scalinganimation. repeatcount = 1;
Scalinganimation. Duration = const_animation_time;
Scalinganimation. autoreverses = no;
Scalinganimation. timingfunction = [camediatimingfunctionfunctionwithname: kcamediatimingfunctioneaseout];
Scalinganimation. fromvalue = [nsvaluevaluewithcatransform3d: catransform3dmakescale (const_enlarge_proportion, const_enlarge_proportion,
(1.0)];
Scalinganimation. tovalue = [nsvaluevaluewithcatransform3d: catransform3dmakescale (1.0, 1.0,
(1.0)];
}
[View. layer addanimation: scalinganimationforkey: @ "descaling"];
View. layer. Transform = catransform3dmakescale (1.0, 1.0,
1.0 );
[Uiview
Commitanimations];
}