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
Working With Scroll Views
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Ash Furrow
March 08, 2012
Programming
96
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Working With Scroll Views
Ash Furrow
March 08, 2012
More Decks by Ash Furrow
See All by Ash Furrow
Migrating to React Native: A Long-Term Retrospective
ashfurrow
0
310
How Artsy Automates Team Culture
ashfurrow
0
3.4k
Building Custom TSLint Rules
ashfurrow
0
490
Circumventing Fear of the Unknown
ashfurrow
1
590
Building Better Software by Building Better Teams
ashfurrow
1
670
Building Open Source Communities
ashfurrow
0
980
Comparative Asynchronous Programming
ashfurrow
2
9.7k
Building Compassionate Software
ashfurrow
0
540
Swift, Briskly
ashfurrow
0
200
Other Decks in Programming
See All in Programming
jQueryをバージョンアップする前に使いたいjQuery Migrate
matsuo_atsushi
0
510
RTSPクライアントを自作してみた話
simotin13
0
610
The NotImplementedError Problem in Ruby
koic
1
800
AIとASP.NET Coreで雑Webアプリを作った話
mayuki
0
640
Hunting Vulnerabilities in Symfony with LLMs
vinceamstoutz
0
540
Spring Security 実践 ─ GraphQL APIで実務に役立つ 認証・認可 を学ぶ
wagyu
0
230
New "Type" system on PicoRuby
pocke
1
930
Semantic Version 単位で戦略を柔軟に変えて、パッケージアップデートを自動化する
daitasu
1
240
ふつうのFeature Flag実践入門
irof
7
4k
コンテキストの使い捨てをやめる — ビジネスルール駆動開発と miko —
ioki
0
200
ローカルLLMでどこまでコードが書けるか -拡張版 / How much code can be written on a local LLM Extended
kishida
11
4.2k
DynamoDBには集計系のクエリがないけどなんとかしたい
musan
1
140
Featured
See All Featured
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6k
Code Review Best Practice
trishagee
74
20k
The Invisible Side of Design
smashingmag
302
52k
For a Future-Friendly Web
brad_frost
183
10k
Testing 201, or: Great Expectations
jmmastey
46
8.2k
Practical Orchestrator
shlominoach
191
11k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
160
Building Flexible Design Systems
yeseniaperezcruz
330
40k
30 Presentation Tips
portentint
PRO
1
320
WENDY [Excerpt]
tessaabrams
11
38k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.1k
Transcript
Working with Scroll Views Ash Furrow Tuesday, 8 May, 12
What is a scroll view? • Subclass of UIView •
A view which scrolls • Sometimes zooms Tuesday, 8 May, 12
What is a scroll view? • Subclass of UIView •
A view which scrolls • Sometimes zooms UIView UIScrollView Tuesday, 8 May, 12
OK, what does “scroll” mean? • A container view that
lets its subviews move around • Maps • Home screen • Table view • Most things that move in iOS Tuesday, 8 May, 12
How to UIScrollView Tuesday, 8 May, 12
How to UIScrollView • Create scroll view, either in xib
or programmatically • Add subviews • ??? • Profit! Tuesday, 8 May, 12
How to UIScrollView • Create scroll view, either in xib
or programmatically • Add subviews • ??? • Profit! • ʵ Set contentSize Tuesday, 8 May, 12
contentSize • Defines the scrollable region • CGSize • Large
contentSize values don’t adversely affect performance Tuesday, 8 May, 12
contentInset Tuesday, 8 May, 12
contentOffset Tuesday, 8 May, 12
Demo: Basic Scroll View Tuesday, 8 May, 12
Scrolling • With Fingers! • Receive delegate callbacks (next slide)
• Programmatically • to top • to new contentOffset • to new rectangle Tuesday, 8 May, 12
Interesting Properties • delaysContentTouches • scrollview gesture recognizers • bounces
• alwaysBouncesVertical • alwaysBouncesHorizontal • scroll indicators (inset & style) • pagingEnabled Tuesday, 8 May, 12
Zooming • I am not an expert at zooming scroll
views • Different approaches • Watch the WWDC videos Tuesday, 8 May, 12
UIScrollViewDelegate • Tracking • Dragging • Decelerating • Zooming •
contentOffset change Tuesday, 8 May, 12
Demo: Paging Tuesday, 8 May, 12
YO, DAWG. I HEARD YOU LIKE SCROLLING. Tuesday, 8 May,
12
UITableViewDelegate • UITableView subclasses UIScrollView • Captures UIScrollViewDelegate callbacks Tuesday,
8 May, 12
Performance • UIScrollView Scales with subviews • Not with contentSize
• UIImage will kill your memory footprint Tuesday, 8 May, 12
Delegate flowcharts • UIScrollViewDelegate is simple • Implementing complex behaviour
with it is not Tuesday, 8 May, 12
Subclassing vs Delegation • Subclassing can break MVC • Better
for repeated behaviours • Delegation can get verbose • You’re writing Objective-C, live with it Tuesday, 8 May, 12
Demo: Reusing Subviews Tuesday, 8 May, 12
Demo: Infinite Scroll Tuesday, 8 May, 12
Ash Furrow
[email protected]
@ashfurrow Podcast: DashDashForce.me http://ashfurrow.com/ScrollViewMaterials.zip Tuesday, 8 May,
12