iOS events (touch, move, shake)

Source: Internet
Author: User

1 //Start Touching2- (void) Touchesbegan: (Nsset *) touches withevent: (Uievent *)Event3 {4NSLog (@"you touch the screen.");5 }6 //Moving7- (void) touchesmoved: (Nsset *) touches withevent: (Uievent *)Event8 {9NSLog (@"Finger Movement");Ten } One //Touch End A- (void) touchesended: (Nsset *) touches withevent: (Uievent *)Event - { -NSLog (@"Touch End"); the } - //Interrupt Touch -- (void) touchescancelled: (Nsset *) touches withevent: (Uievent *)Event - { +NSLog (@"Interrupt Touch"); - } + //start shaking your phone A- (void) Motionbegan: (uieventsubtype) Motion withevent: (Uievent *)Event at { -NSLog (@"Start Shaking"); - } - //The shaking was interrupted -- (void) motioncancelled: (uieventsubtype) Motion withevent: (Uievent *)Event - { inNSLog (@"Interrupt Shaking"); - } to //Shaking End +- (void) motionended: (uieventsubtype) Motion withevent: (Uievent *)Event - { theNSLog (@"Shaking End"); *}

To create a new controller, you can respond to some basic events by adding the basic methods above.

iOS events (touch, move, shake)

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.