1 #import "AppDelegate.h"2 #import<QuartzCore/QuartzCore.h>3 4 @interfaceappdelegate ()5@property (nonatomic, strong) Uiimageview *Birdimage;6 @end7 8 @implementationappdelegate9 Ten-(BOOL) Application: (UIApplication *) application didfinishlaunchingwithoptions: (Nsdictionary *) launchoptions { OneSelf.window =[[UIWindow alloc] initwithframe:[[uiscreen mainscreen] bounds]; A //Override point for customization after application launch. -Self.window.backgroundColor =[Uicolor Whitecolor]; - //Create Uiimageview theSelf.birdimage =[[Uiimageview alloc] initwithframe:[[uiscreen mainscreen] bounds]; - //set Uiimageview to operate -self.birdImage.userInteractionEnabled =YES; - //Add a picture +Self.birdImage.image = [UIImage imagenamed:@"Bird"]; - //Pat gesture +UITapGestureRecognizer *tap =[[UITapGestureRecognizer alloc] initwithtarget:self action: @selector (Tapantion)]; A //add gestures to Uiimageview at [Self.birdimage Addgesturerecognizer:tap]; - [Self.window addSubview:self.birdImage]; - - [Self.window makekeyandvisible]; - returnYES; - } in -- (void) Tapantion to { + //set the background color of a layer -Self.window.layer.backgroundColor =[Uicolor Whitecolor]. Cgcolor; the //Creating animations *Catransition *anim =[catransition animation]; $ //Set up proxyPanax NotoginsengAnim.Delegate=Self ; - //Set Animation time theAnim.duration =1.5; + //absorption effect, like the Trash on Mac effect (private API, not included in the official API) AAnim.type =@"Suckeffect"; the[[Self.birdimage layer] Addanimation:anim forkey:@"Suckeffect"]; + //Hide Self.birdimage (if not hidden, the picture will remain in the window) -Self.birdImage.hidden =YES; $ } $ - @end
Absorbs the effect as if it were a garbage bin on a Mac