SlideShare a Scribd company logo
1 of 124
Download to read offline
Parallactic
CollectionViews
How to add depth into iOS user interfaces
UI Collection View
UICollectionViewDataSource
UICollectionViewCell
UICollectionViewCell
UICollectionViewCell
UICollectionViewCell
UICollectionReusableView
UICollectionViewLayout
UICollectionReusableView
UICollectionReusableView
UICollectionReusableView
UICollectionView
UICollectionViewDelegate
TrulyGreat
Apps
What makes
an app
truly great?
Fitin
Magical
Amazing
First
Impressions
Experience Matters
Let’sgobackintime
AP
Horizontal
Navigation
And now...
iOS 7 is Coming
Opportunity
Design for iOS 7
Depth
Navigation
Tools
We Need
UICollectionView
UICollectionView
iOS 7
How to add depth?
parallax
Examples
http://tinyurl.com/
360Parallax
Not just cool...
How Parallax Works
Relative Motion
You can do this with
UICollection View
WhyCollectionView?
In this session you will:
Master Adding Parallax
to Your Layouts
Let’s Dive In
What are we
building?
The Background
Background View1
UI Collection View
UICollectionViewDataSource
UICollectionViewCell
UICollectionViewCell
UICollectionViewCell
UICollectionViewCell
UICollectionReusableView
UICollectionViewLayout
UICollectionReusableView
UICollectionReusableView
UICollectionReusableView
UICollectionView
UICollectionViewDelegate
Calculating Layout
Metrics
Elements in Rect
- (NSArray *)layoutAttributesForElementsInRect:(CGRect)rect {
Title1
Title2
Title3
Content Content
Content Content
Content
RectElements
in Rect
1
2
3
Calculate
Test
Add
Layout Attributes
- (UICollectionViewLayoutAttributes *)
layoutAttributesForDecorationViewOfKind:(NSString *)decorationViewKind
atIndexPath:(NSIndexPath *)indexPath
Anchor Background2
UICollectionView
UIScrollView
UIView
UIResponder
NSObject
Class Hierarchy
Scroll View
Mechanics
Scroll View
Mechanics
Scroll View Contents
BOUNDS
Scroll View
Mechanics
Scroll View Contents
BOUNDS
Anchor
Anchoring
Subviews
Scroll View Contents
Subview
BOUNDS
Anchoring
Subviews
Scroll View Contents
Subview
BOUNDS
Need New Layout
Metrics on Scroll
Invalidate Layout
- (BOOL)shouldInvalidateLayoutForBoundsChange:(CGRect)newBounds {
Invalidate
Layout
Scroll View Contents
Subview
BOUNDS
-invalidateLayout
-invalidateLayout
-invalidateLayout
-invalidateLayout
-invalidateLayout
New Metrics On
Invalidation
Layout Attributes
- (UICollectionViewLayoutAttributes *)
layoutAttributesForDecorationViewOfKind:(NSString *)decorationViewKind
atIndexPath:(NSIndexPath *)indexPath
Parallax3
It’sabouttoget
complicated
Layout Attributes
- (UICollectionViewLayoutAttributes *)
layoutAttributesForDecorationViewOfKind:(NSString *)decorationViewKind
atIndexPath:(NSIndexPath *)indexPath
Parallactic Offset
Percentage Based
Content
Offset
Scroll View Contents
BOUNDS
0%
100%
50%
Content
Offset
Scroll View Contents
BOUNDS
0%
100%
50%
Content
Offset
Scroll View Contents
BOUNDS
100%
Bounds Height
Content
Offset
Scroll View Contents
BOUNDS
100%
Content Size Height
Content
Offset
Scroll View Contents
BOUNDS
100%
Distance to Travel
Percentage
CGFloat percentageComplete =
self.collectionView.contentOffset.y /
(self.collectionView.contentSize.height - self.collectionView.bounds.size.height);
Calculating
Parallactic Offset
Define
Offset
Parallaxing Background
BOUNDS
Offset
0%
Define
Offset
Parallaxing Background
BOUNDS
Offset
50%
Define
Offset
Parallaxing Background
BOUNDS
Offset
100%
Offset
CGFloat parallaxShift = 6.0;
CGFloat offset =
([self scrollPercentageComplete] * (2 * parallaxShift)) - parallaxShift;
1
2
3
Inspect Collection View Content Offset
Calculate Current Percentage
Calculate Current Parallactic Offset
4 Apply the Parallax Frame
BuildIt
We’ve
Got
Parallax
The Cells
Similar
BuildIt
YOU
Now
can Parallax
One more thing...
Parallactic rainForest
Inspiration
www.spotify.com/us/
Demo
ARCHITECTURE
Parallaxing Cell
Banner
Parallaxing Cell
Banner
Components
Anchor
Cell
Scroll View Contents
Cell 2Cell
Banner
Banner
Banner
Banner
Scroll View Contents
Banner
CellCell 2CellBanner
Banner
Banner
Scroll View Contents
Banner
CellCell 2Cell
Banner
Banner
Banner
Scroll View Contents
Banner
CellCell 2Cell
Banner
Banner
Banner
Scroll View Contents
Banner
CellCell 2Cell
Banner
Banner
Banner
Crop
Scroll View Contents
Cell
Banner
Banner
Banner
Banner
Scroll View Contents
Cell
Banner
Banner
Banner
Banner
Scroll View Contents
Cell 2Cell
Banner
Banner
Banner
Banner
Cell 2
Scroll View Contents
Cell
Banner
Banner
Banner
Banner
Scroll View Contents
Cell 2
Cell
Banner
Banner
Banner
Banner
Scroll View Contents
Cell 2
Banner
Banner
Banner
Banner
Scroll View Contents
Cell 3Cell 2
Banner
Banner
Banner
Banner
Scroll View Contents
Cell 3
Cell 2
Banner
Banner
Banner
Banner
Scroll View Contents
Cell 3
Cell 2
Banner
Banner
Banner
Banner
Scroll View Contents
Cell 3
Banner
Banner
Banner
Banner
Parallax
Define
Offset
Scroll View Contents
Banner
Banner
Parallaxing Cell
Banner
Banner
BOUNDS
Define
Offset
Parallaxing Cell
BOUNDS
Define
Offset
Parallaxing Cell
BOUNDS
Offset
0%
Define
Offset
Parallaxing Cell
BOUNDS
Offset
50%
Define
Offset
Parallaxing Cell
BOUNDS
Offset
100%
So that’s parallax
Why do this?
Fit In
Get Featured by
Apple
And...
delightyourusers
Resources
/RCacheaux/Parallax
René Cacheaux
iOS Architect
rene.cacheaux@mutualmobile.com
rene.cacheaux@gmail.com
@RCachATX
Parallactic Collection Views

More Related Content

What's hot

Appcelerator Titanium Intro
Appcelerator Titanium IntroAppcelerator Titanium Intro
Appcelerator Titanium Intro
Nicholas Jansma
 
A Better Interface Builder Experience
A Better Interface Builder ExperienceA Better Interface Builder Experience
A Better Interface Builder Experience
Justin Munger
 

What's hot (20)

Intro to react native
Intro to react nativeIntro to react native
Intro to react native
 
Android programming-basics
Android programming-basicsAndroid programming-basics
Android programming-basics
 
React Native for ReactJS Devs
React Native for ReactJS DevsReact Native for ReactJS Devs
React Native for ReactJS Devs
 
I Love APIs - Oct 2015
I Love APIs - Oct 2015I Love APIs - Oct 2015
I Love APIs - Oct 2015
 
Introduction to React Native & Rendering Charts / Graphs
Introduction to React Native & Rendering Charts / GraphsIntroduction to React Native & Rendering Charts / Graphs
Introduction to React Native & Rendering Charts / Graphs
 
AHOY FB Hack Day 2017
AHOY FB Hack Day 2017AHOY FB Hack Day 2017
AHOY FB Hack Day 2017
 
Lecture 12: React-Native Firebase Authentication
Lecture 12: React-Native Firebase AuthenticationLecture 12: React-Native Firebase Authentication
Lecture 12: React-Native Firebase Authentication
 
Titanium Appcelerator - Beginners
Titanium Appcelerator - BeginnersTitanium Appcelerator - Beginners
Titanium Appcelerator - Beginners
 
React Native in a nutshell
React Native in a nutshellReact Native in a nutshell
React Native in a nutshell
 
Appcelerator Titanium Intro
Appcelerator Titanium IntroAppcelerator Titanium Intro
Appcelerator Titanium Intro
 
Experiences building apps with React Native @UtrechtJS May 2016
Experiences building apps with React Native @UtrechtJS May 2016Experiences building apps with React Native @UtrechtJS May 2016
Experiences building apps with React Native @UtrechtJS May 2016
 
iOS Coding Best Practices
iOS Coding Best PracticesiOS Coding Best Practices
iOS Coding Best Practices
 
A Better Interface Builder Experience
A Better Interface Builder ExperienceA Better Interface Builder Experience
A Better Interface Builder Experience
 
Introduction to React Native
Introduction to React NativeIntroduction to React Native
Introduction to React Native
 
Introduction to react native
Introduction to react nativeIntroduction to react native
Introduction to react native
 
Getting started with Appcelerator Titanium
Getting started with Appcelerator TitaniumGetting started with Appcelerator Titanium
Getting started with Appcelerator Titanium
 
Angular
AngularAngular
Angular
 
IBDesignable & IBInspectible
IBDesignable & IBInspectibleIBDesignable & IBInspectible
IBDesignable & IBInspectible
 
Swift
SwiftSwift
Swift
 
iPhone University Developer Program
iPhone University Developer ProgramiPhone University Developer Program
iPhone University Developer Program
 

Similar to Parallactic Collection Views

Augmented realityandeducaiotn2
Augmented realityandeducaiotn2Augmented realityandeducaiotn2
Augmented realityandeducaiotn2
Amin Meyghani
 
Christopher Allen's Presentation at eComm 2009
Christopher Allen's Presentation at eComm 2009Christopher Allen's Presentation at eComm 2009
Christopher Allen's Presentation at eComm 2009
eCommConf
 
iOS App Development with Storyboard
iOS App Development with StoryboardiOS App Development with Storyboard
iOS App Development with Storyboard
Babul Mirdha
 
Universal programming recipes​ - Ekaterina Trofimenko - Women In Technology
Universal programming recipes​ - Ekaterina Trofimenko - Women In TechnologyUniversal programming recipes​ - Ekaterina Trofimenko - Women In Technology
Universal programming recipes​ - Ekaterina Trofimenko - Women In Technology
Badoo
 

Similar to Parallactic Collection Views (20)

Making an app like 'Clear' Accessible
Making an app like 'Clear' AccessibleMaking an app like 'Clear' Accessible
Making an app like 'Clear' Accessible
 
Augmented realityandeducaiotn2
Augmented realityandeducaiotn2Augmented realityandeducaiotn2
Augmented realityandeducaiotn2
 
iOS 7 Intro: Engineering and Design
iOS 7 Intro: Engineering and DesigniOS 7 Intro: Engineering and Design
iOS 7 Intro: Engineering and Design
 
Hello world ios v1
Hello world ios v1Hello world ios v1
Hello world ios v1
 
Christopher Allen's Presentation at eComm 2009
Christopher Allen's Presentation at eComm 2009Christopher Allen's Presentation at eComm 2009
Christopher Allen's Presentation at eComm 2009
 
iOS 7
iOS 7 iOS 7
iOS 7
 
iOS Developer Interview Questions
iOS Developer Interview QuestionsiOS Developer Interview Questions
iOS Developer Interview Questions
 
Casestudy
CasestudyCasestudy
Casestudy
 
iOSMumbai Meetup Keynote
iOSMumbai Meetup KeynoteiOSMumbai Meetup Keynote
iOSMumbai Meetup Keynote
 
Comparison between articulate storyline & adobe captivate
Comparison between articulate storyline & adobe captivateComparison between articulate storyline & adobe captivate
Comparison between articulate storyline & adobe captivate
 
Beginning Real World iOS App Development
Beginning Real World iOS App DevelopmentBeginning Real World iOS App Development
Beginning Real World iOS App Development
 
iOS App Development with Storyboard
iOS App Development with StoryboardiOS App Development with Storyboard
iOS App Development with Storyboard
 
"Universal programming recipes", Kateryna Trofimenko
"Universal programming recipes", Kateryna Trofimenko"Universal programming recipes", Kateryna Trofimenko
"Universal programming recipes", Kateryna Trofimenko
 
Universal programming recipes​ - Ekaterina Trofimenko - Women In Technology
Universal programming recipes​ - Ekaterina Trofimenko - Women In TechnologyUniversal programming recipes​ - Ekaterina Trofimenko - Women In Technology
Universal programming recipes​ - Ekaterina Trofimenko - Women In Technology
 
Ux Example
Ux ExampleUx Example
Ux Example
 
New to native? Getting Started With iOS Development
New to native?   Getting Started With iOS DevelopmentNew to native?   Getting Started With iOS Development
New to native? Getting Started With iOS Development
 
iOS 7 Transition guide
iOS 7 Transition guideiOS 7 Transition guide
iOS 7 Transition guide
 
Building native apps with web components
Building native apps with web componentsBuilding native apps with web components
Building native apps with web components
 
React Alicante - React Redux a development workflow
React Alicante - React Redux a development workflowReact Alicante - React Redux a development workflow
React Alicante - React Redux a development workflow
 
10 Essential Widgets Every Flutter Developer Should Know.pdf
10 Essential Widgets Every Flutter Developer Should Know.pdf10 Essential Widgets Every Flutter Developer Should Know.pdf
10 Essential Widgets Every Flutter Developer Should Know.pdf
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 

Parallactic Collection Views