SlideShare a Scribd company logo
1 of 41
Download to read offline
SMOOTH SCROLLING FOR
UITABLEVIEW IN IOS
DESIGNERS MEET DEVELOPERS
MASHUP MEETUP #6 (MAY 2017)
SMOOTH SCROLLING FOR UITABLEVIEW IN IOS
WHO AM I?
▸ Ricardo Pramana Suranta (Edo)
▸ Software Engineer at Ice House Corp.
▸ iOS Developer for 3.5 years, Mobile for ~4 years
▸ Twitter / GitHub: edopelawi
WHAT MAKES A
GREAT UX?
UTILITY
DESIRABILITY
USABILITY
UTILITY
DESIRABILITY
USABILITY
(design + app performance)
PERFORMANCE
MATTERS.
IOS HAS
LONGER DEVICE
SUPPORT TIME
UITABLEVIEW
SMOOTH SCROLLING FOR UITABLEVIEW IN IOS
WHEN TO USE
▸ Repetitive elements
▸ Rich pages
SMOOTH SCROLLING FOR UITABLEVIEW IN IOS
REPETITIVE ELEMENTS
SMOOTH SCROLLING FOR UITABLEVIEW IN IOS
RICH PAGES
UITABLEVIEW
(SC)ROLL
(pls don’t hate me)
SMOOTH SCROLLING FOR UITABLEVIEW IN IOS
HOW TO (SC)ROLL SMOOTHLY
▸ Thread usage
▸ Rendering
▸ Cell creation
▸ Height Calculation
SOCIAL
MEDIA
THREAD USAGE
UI RENDERING
(MOST) APP LOGIC
Main Thread
OTHERS
“Default” Thread
OTHERS
Background, etc.
UI RENDERING
(MOST) APP LOGIC
Main Thread
OTHERS
“Default” Thread
OTHERS
Background, etc.
FASTER CODE
ONLY
API REQUEST,
DB FETCH
ANYTHING
ELSE
SMOOTH SCROLLING FOR UITABLEVIEW IN IOS
NON-BLOCKING OPTIONS
▸ DispatchQueue.qos(.userInitiated).async
▸ URLSessionDataTask
▸ Libraries (e.g. AlamofireImage, SDWebImage)
RENDERING
RED = HEAVY!
OPAQUE
BACKGROUND
COLORS 👌
CELL CREATION
NOT ALL CREATED
CELLS ENDED UP
DISPLAYED!
SMOOTH SCROLLING FOR UITABLEVIEW IN IOS
HOW TO CREATE AND BIND CELL
▸ Create on tableView(_:cellForRowAt:)
▸ Bind the data on tableView(_:willDisplay:forRowAt:)
▸ Add 0.2 - 0.5 seconds data validation in UITableViewCell
▸ Bind data in Main thread
SMOOTH SCROLLING FOR UITABLEVIEW IN IOS
UH OH.
SMOOTH SCROLLING FOR UITABLEVIEW IN IOS
UH OH. (WHY?)
▸ UITableViewAutomaticDimension
▸ AutoLayout
▸ Data binding on tableView(_:cellForRowAt:)
SMOOTH SCROLLING FOR UITABLEVIEW IN IOS
UH OH. (SOLUTION!)
▸ Count manually!
▸ Fast operations: addition, reduction, multiplication,
division
▸ Use UIFont, String, and known width to count multiline
label height
SMOOTH SCROLLING FOR UITABLEVIEW IN IOS
UH OH. (SOLUTION!)
EXTRA: EMPTY
STATE
SMOOTH SCROLLING FOR UITABLEVIEW IN IOS
FAKE RESPONSE SPEED.
CONCLUSION
SMOOTH SCROLLING FOR UITABLEVIEW IN IOS
HOW TO (SC)ROLL SMOOTHLY (CONCLUSION)
▸ Thread usage
▸ Use fast operations in Main thread
▸ Rendering
▸ Prevent color-blended layers
▸ Use similar background colors
SMOOTH SCROLLING FOR UITABLEVIEW IN IOS
HOW TO (SC)ROLL SMOOTHLY (CONCLUSION)
▸ Cell creation
▸ Bind in tableView(_:willDisplay:forRowAt:)
▸ Add delay to prevent unnecessary binding
▸ Height Calculation
▸ Don’t use UITableViewAutomaticDimension
▸ Empty state
SMOOTH SCROLLING FOR UITABLEVIEW IN IOS
FURTHER OPTIMIZATION
▸ Non-Auto Layout UI (CGFrame, CGRect, and old-school
stuffs)
▸ Rendering in CPU (drawRect:, low level stuffs)
QUESTIONS?
SMOOTH SCROLLING FOR UITABLEVIEW IN IOS
FURTHER READING
▸ Sample code repo: https://github.com/edopelawi/
SmoothTableScrollingSample-iOS
▸ https://medium.com/ios-os-x-development/perfect-
smooth-scrolling-in-uitableviews-fd609d5275a5
▸ http://stackoverflow.com/questions/6731545/when-does-
a-view-or-layer-require-offscreen-rendering
WE ARE HIRING!
https://www.icehousecorp.com/careers/
THANK YOU!

More Related Content

Similar to Smooth Scrolling for UITableView in iOS

Getting out of the Job Jungle with Jenkins
Getting out of the Job Jungle with JenkinsGetting out of the Job Jungle with Jenkins
Getting out of the Job Jungle with JenkinsSonatype
 
React Fundamentals - Jakarta JS, Apr 2016
React Fundamentals - Jakarta JS, Apr 2016React Fundamentals - Jakarta JS, Apr 2016
React Fundamentals - Jakarta JS, Apr 2016Simon Sturmer
 
Javaland 2014 / GWT architectures and lessons learned
Javaland 2014 / GWT architectures and lessons learnedJavaland 2014 / GWT architectures and lessons learned
Javaland 2014 / GWT architectures and lessons learnedpgt technology scouting GmbH
 
A tour of React Native
A tour of React NativeA tour of React Native
A tour of React NativeTadeu Zagallo
 
Belgium jenkins-meetup-job-jungle-0.1
Belgium jenkins-meetup-job-jungle-0.1Belgium jenkins-meetup-job-jungle-0.1
Belgium jenkins-meetup-job-jungle-0.1Damien Coraboeuf
 
My 2 Cents of Flutter Development
My 2 Cents of Flutter DevelopmentMy 2 Cents of Flutter Development
My 2 Cents of Flutter DevelopmentDaniel Kao
 
Diving into event-sourcing and event-driven architectures
Diving into event-sourcing and event-driven architecturesDiving into event-sourcing and event-driven architectures
Diving into event-sourcing and event-driven architecturesUnai Esteibar
 
Introduction to iOS7's design changes
Introduction to iOS7's design changesIntroduction to iOS7's design changes
Introduction to iOS7's design changesPauly Ting
 
Cm i padwebdev_lunch_learn
Cm i padwebdev_lunch_learnCm i padwebdev_lunch_learn
Cm i padwebdev_lunch_learnCritical Mass
 
Como Desenvolvemos Mobile na Movile
Como Desenvolvemos Mobile na MovileComo Desenvolvemos Mobile na Movile
Como Desenvolvemos Mobile na MovileMarcos Loiola
 
Gianluca Esposito - It's time to go Native! (with JavaScript and React Native...
Gianluca Esposito - It's time to go Native! (with JavaScript and React Native...Gianluca Esposito - It's time to go Native! (with JavaScript and React Native...
Gianluca Esposito - It's time to go Native! (with JavaScript and React Native...Codemotion
 
iOS performance: tips and tricks to do it better
iOS performance: tips and tricks to do it betteriOS performance: tips and tricks to do it better
iOS performance: tips and tricks to do it betterJulian Król
 
One Page to Test Them All!
One Page to Test Them All!One Page to Test Them All!
One Page to Test Them All!Thoughtworks
 
iOS development made easy
iOS development made easyiOS development made easy
iOS development made easyAdrian Thompson
 
Boundless dec 2014
Boundless dec 2014Boundless dec 2014
Boundless dec 2014mousebird
 
React Native - Why Designers should use React native. And everyone else too.
React Native - Why Designers should use React native. And everyone else too.React Native - Why Designers should use React native. And everyone else too.
React Native - Why Designers should use React native. And everyone else too.Val Scholz
 
OzAltNet Fast-ANDroid-furious
OzAltNet Fast-ANDroid-furiousOzAltNet Fast-ANDroid-furious
OzAltNet Fast-ANDroid-furiousCraig Dunn
 
Tom Germeau: Mobile Apps: Finding the balance between performance and flexibi...
Tom Germeau: Mobile Apps: Finding the balance between performance and flexibi...Tom Germeau: Mobile Apps: Finding the balance between performance and flexibi...
Tom Germeau: Mobile Apps: Finding the balance between performance and flexibi...Chartbeat
 

Similar to Smooth Scrolling for UITableView in iOS (20)

Getting out of the Job Jungle with Jenkins
Getting out of the Job Jungle with JenkinsGetting out of the Job Jungle with Jenkins
Getting out of the Job Jungle with Jenkins
 
React Fundamentals - Jakarta JS, Apr 2016
React Fundamentals - Jakarta JS, Apr 2016React Fundamentals - Jakarta JS, Apr 2016
React Fundamentals - Jakarta JS, Apr 2016
 
Javaland 2014 / GWT architectures and lessons learned
Javaland 2014 / GWT architectures and lessons learnedJavaland 2014 / GWT architectures and lessons learned
Javaland 2014 / GWT architectures and lessons learned
 
A tour of React Native
A tour of React NativeA tour of React Native
A tour of React Native
 
Belgium jenkins-meetup-job-jungle-0.1
Belgium jenkins-meetup-job-jungle-0.1Belgium jenkins-meetup-job-jungle-0.1
Belgium jenkins-meetup-job-jungle-0.1
 
My 2 Cents of Flutter Development
My 2 Cents of Flutter DevelopmentMy 2 Cents of Flutter Development
My 2 Cents of Flutter Development
 
Diving into event-sourcing and event-driven architectures
Diving into event-sourcing and event-driven architecturesDiving into event-sourcing and event-driven architectures
Diving into event-sourcing and event-driven architectures
 
Introduction to iOS7's design changes
Introduction to iOS7's design changesIntroduction to iOS7's design changes
Introduction to iOS7's design changes
 
Cm i padwebdev_lunch_learn
Cm i padwebdev_lunch_learnCm i padwebdev_lunch_learn
Cm i padwebdev_lunch_learn
 
Como Desenvolvemos Mobile na Movile
Como Desenvolvemos Mobile na MovileComo Desenvolvemos Mobile na Movile
Como Desenvolvemos Mobile na Movile
 
Gianluca Esposito - It's time to go Native! (with JavaScript and React Native...
Gianluca Esposito - It's time to go Native! (with JavaScript and React Native...Gianluca Esposito - It's time to go Native! (with JavaScript and React Native...
Gianluca Esposito - It's time to go Native! (with JavaScript and React Native...
 
iOS performance: tips and tricks to do it better
iOS performance: tips and tricks to do it betteriOS performance: tips and tricks to do it better
iOS performance: tips and tricks to do it better
 
One Page to Test Them All!
One Page to Test Them All!One Page to Test Them All!
One Page to Test Them All!
 
iOS development made easy
iOS development made easyiOS development made easy
iOS development made easy
 
Prototyping: Helping to take away the suck
Prototyping: Helping to take away the suckPrototyping: Helping to take away the suck
Prototyping: Helping to take away the suck
 
Boundless dec 2014
Boundless dec 2014Boundless dec 2014
Boundless dec 2014
 
React Native - Why Designers should use React native. And everyone else too.
React Native - Why Designers should use React native. And everyone else too.React Native - Why Designers should use React native. And everyone else too.
React Native - Why Designers should use React native. And everyone else too.
 
OzAltNet Fast-ANDroid-furious
OzAltNet Fast-ANDroid-furiousOzAltNet Fast-ANDroid-furious
OzAltNet Fast-ANDroid-furious
 
Tom Germeau: Mobile Apps: Finding the balance between performance and flexibi...
Tom Germeau: Mobile Apps: Finding the balance between performance and flexibi...Tom Germeau: Mobile Apps: Finding the balance between performance and flexibi...
Tom Germeau: Mobile Apps: Finding the balance between performance and flexibi...
 
Buri2019
Buri2019Buri2019
Buri2019
 

Recently uploaded

call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech studentsHimanshiGarg82
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesVictorSzoltysek
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionOnePlan Solutions
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdfPearlKirahMaeRagusta1
 

Recently uploaded (20)

call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 

Smooth Scrolling for UITableView in iOS