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
270
Session 226 - Core Text and Fonts
wwdcman
0
79
Session 225 - Up and Running: Making a Great Impression with Every Launch
wwdcman
0
100
Featured
See All Featured
RailsConf 2023
tenderlove
29
880
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5k
Learning to Love Humans: Emotional Interface Design
aarron
272
40k
Designing for humans not robots
tammielis
249
25k
Navigating Team Friction
lara
183
14k
YesSQL, Process and Tooling at Scale
rocio
167
14k
Practical Orchestrator
shlominoach
186
10k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
32
1.8k
Happy Clients
brianwarren
97
6.7k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
4
380
Fireside Chat
paigeccino
32
3k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
504
140k
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