Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Session 223 - Enhancing User Experience with Sc...

wwdcman
June 25, 2012
160

Session 223 - Enhancing User Experience with Scroll Views

wwdcman

June 25, 2012
Tweet

Transcript

  1. These are confidential sessions—please refrain from streaming, blogging, or taking

    pictures Session 223 Enhancing User Experience with Scroll Views Josh Shaffer iOS Frameworks
  2. Enhancing User Experience with Scroll Views •UIScrollView configuration •Improving paged

    scrolling •Integrating with OpenGL •Controlling stop offset
  3. Common surprises Run Loop Modes [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(handleTimer:) userInfo:nil

    repeats:NO]; NSTimer *timer = [NSTimer timerWithInterval:1.0 target:self selector:@selector(handleTimer:) userInfo:nil repeats:NO];
  4. Common surprises Run Loop Modes [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(handleTimer:) userInfo:nil

    repeats:NO]; NSTimer *timer = [NSTimer timerWithInterval:1.0 target:self selector:@selector(handleTimer:) userInfo:nil repeats:NO]; [[NSRunLoop mainRunLoop] addTimer:timer forMode:NSCommonRunLoopModes];
  5. Common surprises Run Loop Modes [self performSelector:@selector(performDelayedWork) withObject:nil afterDelay:1.0]; [self

    performSelector:@selector(performDelayedWork) withObject:nil afterDelay:1.0 inModes:@[NSCommonRunLoopModes]];
  6. Application Delegate Application Window Parent View’s View Controller Parent View

    UIResponder and Event Delivery Parent View Child View Child View
  7. Application Delegate Application Window Parent View’s View Controller Parent View

    UIResponder and Event Delivery Parent View Child View Child View
  8. Application Delegate Application Window OpenGL View’s View Controller OpenGL View

    UIResponder and Event Delivery OpenGL View Scroll View Scroll View
  9. Application Delegate Application Window OpenGL View’s View Controller OpenGL View

    UIResponder and Event Delivery OpenGL View Scroll View Scroll View
  10. How not to do it UIResponder and Event Delivery -

    (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { [[self nextResponder] touchesBegan:touches withEvent:event]; }
  11. How not to do it UIResponder and Event Delivery -

    (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { [[self nextResponder] touchesBegan:touches withEvent:event]; }
  12. How not to do it UIResponder and Event Delivery -

    (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { [[self nextResponder] touchesBegan:touches withEvent:event]; } Application Delegate Application Window OpenGL View’s View Controller OpenGL View Scroll View
  13. Application Delegate Application Window OpenGL View’s View Controller OpenGL View

    UIResponder and Event Delivery OpenGL View Scroll View Scroll View
  14. Application Delegate Application Window OpenGL View’s View Controller OpenGL View

    OpenGL View Scroll View Scroll View UIResponder and Event Delivery
  15. Scroll View OpenGL View Application Delegate Application Window OpenGL View’s

    View Controller OpenGL View Scroll View UIResponder and Event Delivery
  16. Scroll View Application Delegate Application Window OpenGL View’s View Controller

    OpenGL View Scroll View UIResponder and Event Delivery OpenGL View
  17. Scroll View Application Delegate Application Window OpenGL View’s View Controller

    OpenGL View Scroll View UIResponder and Event Delivery OpenGL View
  18. Scroll View Application Delegate Application Window OpenGL View’s View Controller

    OpenGL View UIResponder and Event Delivery OpenGL View
  19. Scroll View Application Delegate Application Window OpenGL View’s View Controller

    OpenGL View UIResponder and Event Delivery OpenGL View
  20. Scroll View Application Delegate Application Window OpenGL View’s View Controller

    OpenGL View UIResponder and Event Delivery OpenGL View Child View Child View
  21. Scroll View Application Delegate Application Window OpenGL View’s View Controller

    OpenGL View UIResponder and Event Delivery OpenGL View Child View Child View
  22. Scroll View Application Delegate Application Window OpenGL View’s View Controller

    OpenGL View UIResponder and Event Delivery OpenGL View Child View Child View
  23. Jake Behrens UI Frameworks Evangelist [email protected] Documentation Scroll View Programming

    Guide for iOS http://developer.apple.com/library/ios/#documentation/WindowsViews/Conceptual/UIScrollView_pg Apple Developer Forums http://devforums.apple.com More Information