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
82
Session 225 - Up and Running: Making a Great Impression with Every Launch
wwdcman
0
100
Featured
See All Featured
For a Future-Friendly Web
brad_frost
175
9.4k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
27
4.3k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
Statistics for Hackers
jakevdp
796
220k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
6.9k
Agile that works and the tools we love
rasmusluckow
327
21k
The Art of Programming - Codeland 2020
erikaheidi
52
13k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
720
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.5k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
364
24k
Ruby is Unlike a Banana
tanoku
97
11k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2.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