in IOS, all objects that appear on the interface are inherited directly or indirectly from Uiresponder, and can only handle events if they inherit it. The events in iOS can be categorized into three main categories:
1. Touch Events
2. Accelerometer events (Shake)
3. Remote Control Events
As long as the finger touches the screen, slides, and leaves the screen, the system generates an event of the Uievent object type---Of course including the Uitouch event
1 /* * 2 * start touch (i.e. finger touch screen (view) that moment)3 */ 4 -(void) Touchesbegan: (Nsset *) touches withevent: (uievent *)event;
1 /* * 2 * touch in progress .... 3 */4 -(void) touchesmoved: (Nsset *) touches withevent: ( Uievent *)event;
/* * * */-(void) touchesended: (Nsset *) touches withevent: (uievent *)event;
1 /* * 2 * Touch Interrupt 3 */ 4 -(void) touchescancelled: (Nsset *) touches withevent: (uievent *)event;
IOS 3.0 + starts to support motion events, especially shaking devices, such as the shake-and-shake feature in.
Execution at start of movement
-(void) Motionbegan: (uieventsubtype) Motion withevent: (uievent *)event Ns_available_ios (3_0);
Execution at the end of the campaign
-(void) motionended: (uieventsubtype) Motion withevent: (uievent *)event Ns_available_ios (3_0);
Execution when motion is canceled
-(void) motioncancelled: (uieventsubtype) Motion withevent: (uievent *)event Ns_available_ios (3_0);
IOS 4.0 + start to support remote events
-(void) Remotecontrolreceivedwithevent: (uievent *)event Ns_available_ios (4_0);
The following is an enumeration definition of three types of event Uieventtype
typedef ns_enum (Nsinteger, Uieventtype) {uieventtypetouches, uieventtypemotion, uieventtyperemotecontrol,};typed EF Ns_enum (Nsinteger, uieventsubtype) {//available in IPhone OS 3.0Uieventsubtypenone =0, //for Uieventtypemotion, available in IPhone OS 3.0Uieventsubtypemotionshake =1, //for Uieventtyperemotecontrol, available in IOS 4.0Uieventsubtyperemotecontrolplay = -, Uieventsubtyperemotecontrolpause=101, Uieventsubtyperemotecontrolstop=102, Uieventsubtyperemotecontroltoggleplaypause=103, Uieventsubtyperemotecontrolnexttrack=104, Uieventsubtyperemotecontrolprevioustrack= the, Uieventsubtyperemotecontrolbeginseekingbackward=106, Uieventsubtyperemotecontrolendseekingbackward=107, Uieventsubtyperemotecontrolbeginseekingforward=108, Uieventsubtyperemotecontrolendseekingforward=109,};
Three big events in iOS