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
73
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
180
How Artsy Automates Team Culture
ashfurrow
0
2.8k
Building Custom TSLint Rules
ashfurrow
0
360
Circumventing Fear of the Unknown
ashfurrow
1
460
Building Better Software by Building Better Teams
ashfurrow
1
500
Building Open Source Communities
ashfurrow
0
760
Comparative Asynchronous Programming
ashfurrow
2
9.2k
Building Compassionate Software
ashfurrow
0
350
Swift, Briskly
ashfurrow
0
110
Other Decks in Programming
See All in Programming
WebフロントエンドにおけるGraphQL(あるいはバックエンドのAPI)との向き合い方 / #241106_plk_frontend
izumin5210
4
1.4k
.NET のための通信フレームワーク MagicOnion 入門 / Introduction to MagicOnion
mayuki
1
1.8k
Less waste, more joy, and a lot more green: How Quarkus makes Java better
hollycummins
0
100
NSOutlineView何もわからん:( 前編 / I Don't Understand About NSOutlineView :( Pt. 1
usagimaru
0
340
イベント駆動で成長して委員会
happymana
1
340
Better Code Design in PHP
afilina
PRO
0
130
C++でシェーダを書く
fadis
6
4.1k
React への依存を最小にするフロントエンド設計
takonda
12
2.7k
Why Jakarta EE Matters to Spring - and Vice Versa
ivargrimstad
0
1.2k
Nurturing OpenJDK distribution: Eclipse Temurin Success History and plan
ivargrimstad
0
1k
見せてあげますよ、「本物のLaravel批判」ってやつを。
77web
7
7.8k
CSC509 Lecture 09
javiergs
PRO
0
140
Featured
See All Featured
Agile that works and the tools we love
rasmusluckow
327
21k
The World Runs on Bad Software
bkeepers
PRO
65
11k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
25
1.8k
Designing on Purpose - Digital PM Summit 2013
jponch
115
7k
It's Worth the Effort
3n
183
27k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
0
110
Visualization
eitanlees
145
15k
GitHub's CSS Performance
jonrohan
1030
460k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.8k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.1k
Done Done
chrislema
181
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