Dev:UIApplication/Event recording

Event recorder
Event recording is supported by two private methods, -_addRecorder: and -_removeRecorder:. It uses the delegation pattern. The recorder object will be informed whenever an event arrives. There can be multiple event recorders.

A recorder object must conform to the informal protocol the argument event is the plist representation of the GSEvent, converted using the GSEventCreatePlistRepresentation function.

Example implementation
This code will record events into the file events.plist.

Event playback
Event playbacks allows you to send recorded events back the UI elements. It can be used as a macro system, or UI unit testing.

Playbacks are called through the -_playbackEvents:atPlaybackRate:messageWhenDone:withSelector: method. where the content of info is:
 * 1) The events is an NSArray of NSDictionary's (which are GSEvents).
 * 2) The playback rate is a number governing the speed the events will be sent. The larger the number, the faster it will go. By default you should pass 1.
 * 3) The target is informed when the playback is done. The selector should have the signature
 * UIApplicationEventRecordingDeliveryTimeUserInfoKey: An NSArray which contains the time where the corresponding event happened.

Example implementation
Assume the events are recorded to event.plist: