iOS Gesture Recognizers
CocoaConf Boston • October 2013 Jonathan Penn
iOS Gesture Recognizers CocoaConf Boston October 2013 Jonathan - - PowerPoint PPT Presentation
iOS Gesture Recognizers CocoaConf Boston October 2013 Jonathan Penn @jonathanpenn Slides n Sample Code rubbercitywizards.com/stu ff Ti e problem... - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event -
CocoaConf Boston • October 2013 Jonathan Penn
withEvent:(UIEvent *)event
withEvent:(UIEvent *)event
withEvent:(UIEvent *)event
withEvent:(UIEvent *)event { remember when, where for the touches }
withEvent:(UIEvent *)event { if one finger: is user panning? adjust offset if two fingers: am I rotating? what angle? am I pinching? what scale? }
withEvent:(UIEvent *)event { if one finger: is user panning? adjust offset if two fingers: am I rotating? what angle? am I pinching? what scale? }
withEvent:(UIEvent *)event { if one finger: is user panning? adjust offset if two fingers: am I rotating? what angle? am I pinching? what scale? }
withEvent:(UIEvent *)event { if one finger: is user panning? adjust offset if two fingers: am I rotating? what angle? am I pinching? what scale? }
withEvent:(UIEvent *)event { if one finger: is user panning? adjust offset if two fingers: am I rotating? what angle? am I pinching? what scale? }
withEvent:(UIEvent *)event { if one finger: is user panning? adjust offset if two fingers: am I rotating? what angle? am I pinching? what scale? }
withEvent:(UIEvent *)event { did we already pan? did we already rotate? did we already pinch? did we move to far for a tap? did we wait to long for a tap? if not: then TAP! }
withEvent:(UIEvent *)event { did we already pan? did we already rotate? did we already pinch? did we move to far for a tap? did we wait to long for a tap? if not: then TAP! }
withEvent:(UIEvent *)event { did we already pan? did we already rotate? did we already pinch? did we move to far for a tap? did we wait to long for a tap? if not: then TAP! }
withEvent:(UIEvent *)event { did we already pan? did we already rotate? did we already pinch? did we move to far for a tap? did we wait to long for a tap? if not: then TAP! }
withEvent:(UIEvent *)event { did we already pan? did we already rotate? did we already pinch? did we move to far for a tap? did we wait to long for a tap? if not: then TAP! }
withEvent:(UIEvent *)event { did we already pan? did we already rotate? did we already pinch? did we move to far for a tap? did we wait to long for a tap? if not: then TAP! }
{ // ... }
{ // ... }
{ // ... }
target/action
possible recognized failed
possible recognized failed
possible began changed ended cancelled
{ // ... }
{ // ... }
{ // ... }
target/action target/action
delegate
shouldRecognizeSimultaneouslyWithGestureRecognizer:...
{ // ... }
{ // ... }
jonathan@rubbercitywizards.com