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
Ash Furrow
March 08, 2012
Programming
1
76
Working With Scroll Views
Ash Furrow
March 08, 2012
Tweet
Share
More Decks by Ash Furrow
See All by Ash Furrow
Migrating to React Native: A Long-Term Retrospective
ashfurrow
0
190
How Artsy Automates Team Culture
ashfurrow
0
2.9k
Building Custom TSLint Rules
ashfurrow
0
380
Circumventing Fear of the Unknown
ashfurrow
1
480
Building Better Software by Building Better Teams
ashfurrow
1
520
Building Open Source Communities
ashfurrow
0
790
Comparative Asynchronous Programming
ashfurrow
2
9.2k
Building Compassionate Software
ashfurrow
0
380
Swift, Briskly
ashfurrow
0
110
Other Decks in Programming
See All in Programming
AHC041解説
terryu16
0
590
AWS Lambda functions with C# 用の Dev Container Template を作ってみた件
mappie_kochi
0
240
[Fin-JAWS 第38回 ~re:Invent 2024 金融re:Cap~]FaultInjectionServiceアップデート@pre:Invent2024
shintaro_fukatsu
0
400
Immutable ActiveRecord
megane42
0
130
Kanzawa.rbのLT大会を支える技術の裏側を変更する Ruby on Rails + Litestream 編
muryoimpl
0
220
Pythonでもちょっとリッチな見た目のアプリを設計してみる
ueponx
1
480
Writing documentation can be fun with plugin system
okuramasafumi
0
120
ARA Ansible for the teams
kksat
0
150
一休.com のログイン体験を支える技術 〜Web Components x Vue.js 活用事例と最適化について〜
atsumim
0
110
知られざるDMMデータエンジニアの生態 〜かつてツチノコと呼ばれし者〜
takaha4k
4
1.3k
第3回関東Kaggler会_AtCoderはKaggleの役に立つ
chettub
3
890
2024年のWebフロントエンドのふりかえりと2025年
sakito
1
230
Featured
See All Featured
Optimising Largest Contentful Paint
csswizardry
34
3.1k
Testing 201, or: Great Expectations
jmmastey
41
7.2k
Designing for humans not robots
tammielis
250
25k
We Have a Design System, Now What?
morganepeng
51
7.4k
Optimizing for Happiness
mojombo
376
70k
Music & Morning Musume
bryan
46
6.3k
Reflections from 52 weeks, 52 projects
jeffersonlam
348
20k
Scaling GitHub
holman
459
140k
YesSQL, Process and Tooling at Scale
rocio
171
14k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
Six Lessons from altMBA
skipperchong
27
3.6k
Done Done
chrislema
182
16k
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