Absorption effect, like the effect of a trash bin on a Mac

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.