Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Session 223 - Enhancing User Experience with Sc...
Search
wwdcman
June 25, 2012
0
160
Session 223 - Enhancing User Experience with Scroll Views
wwdcman
June 25, 2012
Tweet
Share
More Decks by wwdcman
See All by wwdcman
Session 409 - Learning Instruments
wwdcman
1
130
Session 412 - Debugging with Xcode
wwdcman
0
110
Session 404 - Building from the Command Line with Xcode
wwdcman
0
140
Session 306 - Integrating With Facebook, Twitter and Sina Weibo
wwdcman
0
200
Session 230 - Advanced Attributed Strings for iOS
wwdcman
0
75
Session 228 - Best Practices for Mastering Auto Layout
wwdcman
0
1.5k
Session 227 - Using iCloud with Core Data
wwdcman
0
280
Session 226 - Core Text and Fonts
wwdcman
0
83
Session 225 - Up and Running: Making a Great Impression with Every Launch
wwdcman
0
100
Featured
See All Featured
Fashionably flexible responsive web design (full day workshop)
malarkey
405
66k
Typedesign – Prime Four
hannesfritz
40
2.4k
How to train your dragon (web standard)
notwaldorf
88
5.7k
KATA
mclloyd
29
14k
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Producing Creativity
orderedlist
PRO
342
39k
Intergalactic Javascript Robots from Outer Space
tanoku
270
27k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.2k
Adopting Sorbet at Scale
ufuk
73
9.1k
Transcript
These are confidential sessions—please refrain from streaming, blogging, or taking
pictures Session 223 Enhancing User Experience with Scroll Views Josh Shaffer iOS Frameworks
Enhancing User Experience with Scroll Views
Enhancing User Experience with Scroll Views •UIScrollView configuration
Enhancing User Experience with Scroll Views •UIScrollView configuration •Improving paged
scrolling
Enhancing User Experience with Scroll Views •UIScrollView configuration •Improving paged
scrolling •Integrating with OpenGL
Enhancing User Experience with Scroll Views •UIScrollView configuration •Improving paged
scrolling •Integrating with OpenGL •Controlling stop offset
Review of the basics UIScrollView Configuration
Content Size
contentSize.height contentSize.width Content Size
320 Content Offset
Content Offset 320
Content Offset 320
Content Offset
View for Zooming in Scroll View
View for Zooming in Scroll View
Paged Scrolling
Paged Scrolling
View Configuration
View Configuration
View Configuration Paging UIScrollView
View Configuration Paging UIScrollView Zooming UIScrollViews
View Configuration Paging UIScrollView Zooming UIScrollViews UIImageViews
View Configuration Paging UIScrollView Zooming UIScrollViews UIImageViews UIPageViewController
View Configuration UIPageViewController Zooming UIScrollViews UIImageViews
Page Spacing
Page Spacing
Page Spacing UIPageViewControllerOptionInterPageSpacingKey
Page Spacing
Page Spacing
Paged Scrolling
Paged Scrolling
Paged Scrolling After view controller
Paged Scrolling
Paged Scrolling
Paged Scrolling Before view controller
Paged Scrolling
Zooming
Zooming
Paged Scrolling
Paged Scrolling
Demo Eliza Block
Integrating UIScrollView and OpenGL
None
None
None
None
None
None
None
None
None
None
UIScrollView
Demo Eliza Block
Common surprises Run Loop Modes
Common surprises Run Loop Modes [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(handleTimer:) userInfo:nil
repeats:NO];
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];
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];
Common surprises Run Loop Modes
Common surprises Run Loop Modes [self performSelector:@selector(performDelayedWork) withObject:nil afterDelay:1.0];
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]];
UIResponder and Event Delivery
UIResponder and Event Delivery Parent View
UIResponder and Event Delivery Parent View Child View
UIResponder and Event Delivery Parent View Child View
UIResponder and Event Delivery Parent View Child View Child View
Parent View UIResponder and Event Delivery Parent View Child View
Child View
Parent View’s View Controller Parent View UIResponder and Event Delivery
Parent View Child View Child View
Window Parent View’s View Controller Parent View UIResponder and Event
Delivery Parent View Child View Child View
Application Window Parent View’s View Controller Parent View UIResponder and
Event Delivery Parent View Child View Child View
Application Delegate Application Window Parent View’s View Controller Parent View
UIResponder and Event Delivery Parent View Child View Child View
Application Delegate Application Window Parent View’s View Controller Parent View
UIResponder and Event Delivery Parent View Child View Child View
UIResponder and Event Delivery OpenGL View Scroll View
UIResponder and Event Delivery OpenGL View Scroll View
UIResponder and Event Delivery OpenGL View Scroll View Scroll View
Application Delegate Application Window OpenGL View’s View Controller OpenGL View
UIResponder and Event Delivery OpenGL View Scroll View Scroll View
Application Delegate Application Window OpenGL View’s View Controller OpenGL View
UIResponder and Event Delivery OpenGL View Scroll View Scroll View
How not to do it UIResponder and Event Delivery
How not to do it UIResponder and Event Delivery -
(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { [[self nextResponder] touchesBegan:touches withEvent:event]; }
How not to do it UIResponder and Event Delivery -
(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { [[self nextResponder] touchesBegan:touches withEvent:event]; }
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
Application Delegate Application Window OpenGL View’s View Controller OpenGL View
UIResponder and Event Delivery OpenGL View Scroll View Scroll View
Application Delegate Application Window OpenGL View’s View Controller OpenGL View
OpenGL View Scroll View Scroll View UIResponder and Event Delivery
Scroll View OpenGL View Application Delegate Application Window OpenGL View’s
View Controller OpenGL View Scroll View UIResponder and Event Delivery
Scroll View Application Delegate Application Window OpenGL View’s View Controller
OpenGL View Scroll View UIResponder and Event Delivery OpenGL View
Scroll View Application Delegate Application Window OpenGL View’s View Controller
OpenGL View Scroll View UIResponder and Event Delivery OpenGL View
Scroll View Application Delegate Application Window OpenGL View’s View Controller
OpenGL View UIResponder and Event Delivery OpenGL View
Scroll View Application Delegate Application Window OpenGL View’s View Controller
OpenGL View UIResponder and Event Delivery OpenGL View
Scroll View Application Delegate Application Window OpenGL View’s View Controller
OpenGL View UIResponder and Event Delivery OpenGL View Child View Child View
Scroll View Application Delegate Application Window OpenGL View’s View Controller
OpenGL View UIResponder and Event Delivery OpenGL View Child View Child View
Scroll View Application Delegate Application Window OpenGL View’s View Controller
OpenGL View UIResponder and Event Delivery OpenGL View Child View Child View
Demo Eliza Block
None
None
None
None
None
Deceleration Targets
Deceleration Targets - (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset
Deceleration Targets - (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset {
*targetContentOffset = ClosestCarOffset(*targetContentOffset); }
Demo Eliza Block
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
Introducing Collection Views Marina Thursday 9:00AM Related Sessions Building Advanced
Gesture Recognizers Marina Thursday 11:30AM
Scroll Views on iOS Lab Essentials Lab A Thursday 9:00AM
Labs
None
None
None
None