1.0 events in iOS and 1.0iOS
When a user uses an app, various events are generated. Events in iOS can be divided into three types: UIKit can recognize three types of input events:
- Touch event
- Accelerator event/motion event
- Remote Control event
|
UIResponder-response object Concept:
In iOS, not all objects can process events. Only objects that inherit UIResponder can receive and process events. |
Member:
UIApplication, UIViewController, and UIView are all inherited from UIResponder. Therefore, they are all responder objects that can receive and process events. |
Internal method of UIResponder:
1 // touch event 2-(void) touchesBegan :( NSSet <UITouch *> *) touches withEvent :( nullable UIEvent *) event; 3-(void) touchesMoved :( NSSet <UITouch *> *) touches withEvent :( nullable UIEvent *) event; 4-(void) Events :( NSSet <UITouch *> *) touches withEvent :( nullable UIEvent *) event; 5-(void) touchesCancelled :( nullable NSSet <UITouch *> *) touches withEvent :( nullable UIEvent *) event; 6-(void) handle :( NSSet * _ Nonnull) touches NS_AVAILABLE_IOS (9_1 );
1 // accelerator event 2-(void) motionBegan :( UIEventSubtype) motion withEvent :( nullable UIEvent *) event NS_AVAILABLE_IOS (3_0); 3-(void) motionEnded :( UIEventSubtype) motion withEvent :( nullable UIEvent *) event failed (3_0); 4-(void) motionCancelled :( UIEventSubtype) motion withEvent :( nullable UIEvent *) event NS_AVAILABLE_IOS (3_0 );
// Remote Control event-(void) remoteControlReceivedWithEvent :( nullable UIEvent *) event NS_AVAILABLE_IOS (4_0 );
If you have any questions, please send an e-mail to shorfng@126.com to contact me. By: Loto)