iOS Edge Learning-touch events and uiview exercises that can be dragged

Source: Internet
Author: User

First, the user in the process of using the app, will produce a variety of events. The events in iOS can be divided into 3 major types:

Second, the responder object

  • Only objects that inherit Uiresponder in iOS can accept and handle events, which are called "responder objects"
  • UIApplication, Uiviewcontroller, and UIView inherit from Uiresponder, so they are all responder objects and can accept and handle events
  • Uiresponder internally provides the following methods to handle events

Third, the practice of UIView touch events are familiar

Iv. Uitouch

  • One finger corresponds to a Uitouch object
  • Uitouch: Holds information related to a finger, such as the position, time, and stage of a touch
  • Note: In iphone development, to avoid using double-click events!

V. Methods of Uitouch

Vi. examples of event delivery

Vii. UIView cannot receive three cases of touch events

Viii. exercises based on UIView touch events--the ability to drag UIView

iOS Edge Learning-touch events and uiview exercises that can be dragged

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.