SlideShare a Scribd company logo
1 of 21
Download to read offline
Using
Swift Enums
for safer
UICollectionViews
and
UITableViews
swift.berlin meetup
November 30, 2015
Ariel Elkin
PROJECT A
• Early-stage investor and company builder
• Marketplaces, E-commerce, Saas
• 20+ companies in our portfolio
ME
• iOS Developer in Project A’s Mobile Team
• 10+ apps in the App Store
• Puts his dishes in the dishwasher
COLLECTION VIEWS ARE COMPLEX
• section numbers
• item sizes
• section count
• reuse identifiers
• etc…
MANAGING THE LAYOUT STRUCTURE
• Typically involves hard-coding
integer values
MANAGING THE LAYOUT STRUCTURE
• Layout information is
fragmented
DISADVANTAGES
MANAGING THE LAYOUT STRUCTURE
• We have to manually ensure
that checks are exhaustive
DISADVANTAGES
MANAGING THE LAYOUT STRUCTURE
• Error handling not included
DISADVANTAGES
THE LAYOUT
STRUCTURE?
HOW CAN THE
COMPILER HELP US WITH
ENUMS
ENUMS
• turn the layout structure
into a type
NATURAL ERROR-HANDLING
ENUMS
EXHAUSTIVITY
ENUMS
EXHAUSTIVITY
ENUMS
ENUM FUNCTIONS AND PROPERTIES
ENUMS
COUNT
ENUMS
AUTOCOMPLETION GOODNESS
ENUMS
DEMO
FAVOUR DECOUPLING
ENUMS
THANK YOU!
QUESTIONS?

More Related Content

Viewers also liked

03การพัฒนารูปแบบการเรียนการสอนโดยเน้นผู้เรียนเป็นสำคัญในวิชาภาษีเงินได้บุคคลธ...
03การพัฒนารูปแบบการเรียนการสอนโดยเน้นผู้เรียนเป็นสำคัญในวิชาภาษีเงินได้บุคคลธ...03การพัฒนารูปแบบการเรียนการสอนโดยเน้นผู้เรียนเป็นสำคัญในวิชาภาษีเงินได้บุคคลธ...
03การพัฒนารูปแบบการเรียนการสอนโดยเน้นผู้เรียนเป็นสำคัญในวิชาภาษีเงินได้บุคคลธ...Yeah Pitloke
 
Espacio verde Magaldi y Unamuno
Espacio verde Magaldi y UnamunoEspacio verde Magaldi y Unamuno
Espacio verde Magaldi y UnamunoDaniel Chain
 
Untitled Infographic
Untitled InfographicUntitled Infographic
Untitled Infographicbriwa
 
Elise evaluation
Elise   evaluation Elise   evaluation
Elise evaluation KExcell
 
Jean Nouvel - Isabel Alejandra Vargas Herrera
Jean Nouvel - Isabel Alejandra Vargas HerreraJean Nouvel - Isabel Alejandra Vargas Herrera
Jean Nouvel - Isabel Alejandra Vargas HerreraFabiola Aranda
 
ライフサポートマネジメント研究所
ライフサポートマネジメント研究所ライフサポートマネジメント研究所
ライフサポートマネジメント研究所lifesupport-ken
 
Concepts of rpi /prosthodontic courses
Concepts of rpi /prosthodontic coursesConcepts of rpi /prosthodontic courses
Concepts of rpi /prosthodontic coursesIndian dental academy
 
Nutrición vs Alimentación
Nutrición vs AlimentaciónNutrición vs Alimentación
Nutrición vs Alimentacióncharito ybarra
 

Viewers also liked (11)

03การพัฒนารูปแบบการเรียนการสอนโดยเน้นผู้เรียนเป็นสำคัญในวิชาภาษีเงินได้บุคคลธ...
03การพัฒนารูปแบบการเรียนการสอนโดยเน้นผู้เรียนเป็นสำคัญในวิชาภาษีเงินได้บุคคลธ...03การพัฒนารูปแบบการเรียนการสอนโดยเน้นผู้เรียนเป็นสำคัญในวิชาภาษีเงินได้บุคคลธ...
03การพัฒนารูปแบบการเรียนการสอนโดยเน้นผู้เรียนเป็นสำคัญในวิชาภาษีเงินได้บุคคลธ...
 
Transcript 1
Transcript 1Transcript 1
Transcript 1
 
Espacio verde Magaldi y Unamuno
Espacio verde Magaldi y UnamunoEspacio verde Magaldi y Unamuno
Espacio verde Magaldi y Unamuno
 
Media Evaluation
Media EvaluationMedia Evaluation
Media Evaluation
 
Untitled Infographic
Untitled InfographicUntitled Infographic
Untitled Infographic
 
Elise evaluation
Elise   evaluation Elise   evaluation
Elise evaluation
 
Jean Nouvel - Isabel Alejandra Vargas Herrera
Jean Nouvel - Isabel Alejandra Vargas HerreraJean Nouvel - Isabel Alejandra Vargas Herrera
Jean Nouvel - Isabel Alejandra Vargas Herrera
 
ライフサポートマネジメント研究所
ライフサポートマネジメント研究所ライフサポートマネジメント研究所
ライフサポートマネジメント研究所
 
Concepts of rpi /prosthodontic courses
Concepts of rpi /prosthodontic coursesConcepts of rpi /prosthodontic courses
Concepts of rpi /prosthodontic courses
 
13.probiotics
13.probiotics13.probiotics
13.probiotics
 
Nutrición vs Alimentación
Nutrición vs AlimentaciónNutrición vs Alimentación
Nutrición vs Alimentación
 

Similar to Using Swift Enums for safer UICollectionViews and UITableViews

iOS Programming 101
iOS Programming 101iOS Programming 101
iOS Programming 101rwenderlich
 
Serverless operations for the iRobot fleet
Serverless operations for the iRobot fleetServerless operations for the iRobot fleet
Serverless operations for the iRobot fleetBen Kehoe
 
iOS Testing With Appium at Gilt
iOS Testing With Appium at GiltiOS Testing With Appium at Gilt
iOS Testing With Appium at GiltGilt Tech Talks
 
Industrial manufacturing and IFS Applications 8: customer case
Industrial manufacturing and IFS Applications 8: customer caseIndustrial manufacturing and IFS Applications 8: customer case
Industrial manufacturing and IFS Applications 8: customer caseIFS
 
Automate REST API Testing
Automate REST API TestingAutomate REST API Testing
Automate REST API TestingTechWell
 
Good bye Massive View Controller!
Good bye Massive View Controller!Good bye Massive View Controller!
Good bye Massive View Controller!Supercharge
 
iOS apps in Swift
iOS apps in SwiftiOS apps in Swift
iOS apps in SwiftNuno Dias
 
INTERFACE by apidays_Recommendations for API Governance and an API Economy Ce...
INTERFACE by apidays_Recommendations for API Governance and an API Economy Ce...INTERFACE by apidays_Recommendations for API Governance and an API Economy Ce...
INTERFACE by apidays_Recommendations for API Governance and an API Economy Ce...apidays
 
Sencha Auckland Conference (SenchaCon) AdvanceRetail Presentation
Sencha Auckland Conference (SenchaCon) AdvanceRetail PresentationSencha Auckland Conference (SenchaCon) AdvanceRetail Presentation
Sencha Auckland Conference (SenchaCon) AdvanceRetail PresentationAndrew Bell
 
Building front-end apps that Scale - FOSDEM 2014
Building front-end apps that Scale - FOSDEM 2014Building front-end apps that Scale - FOSDEM 2014
Building front-end apps that Scale - FOSDEM 2014Phil Leggetter
 
Learnings for Accessibility for iOS Platform
Learnings for Accessibility for iOS PlatformLearnings for Accessibility for iOS Platform
Learnings for Accessibility for iOS PlatformTasneem Sayeed
 
AEM 6.0 Touch-optimized UI
AEM 6.0 Touch-optimized UIAEM 6.0 Touch-optimized UI
AEM 6.0 Touch-optimized UIGilles Knobloch
 
App Development with Apple Swift Certification at Certiport Centers
App Development with Apple Swift Certification at Certiport CentersApp Development with Apple Swift Certification at Certiport Centers
App Development with Apple Swift Certification at Certiport CentersNR Computer Learning Center
 
How to Assure Performance in Hybrid Cloud Ecosystems
How to Assure Performance in Hybrid Cloud EcosystemsHow to Assure Performance in Hybrid Cloud Ecosystems
How to Assure Performance in Hybrid Cloud EcosystemseG Innovations
 
Building your first iOS app using Xamarin
Building your first iOS app using XamarinBuilding your first iOS app using Xamarin
Building your first iOS app using XamarinGill Cleeren
 
iPhone Camp Birmingham (Bham) - Intro To iPhone Development
iPhone Camp Birmingham (Bham) - Intro To iPhone DevelopmentiPhone Camp Birmingham (Bham) - Intro To iPhone Development
iPhone Camp Birmingham (Bham) - Intro To iPhone Developmentandriajensen
 
Pradeep Kumar _Profile
Pradeep Kumar _ProfilePradeep Kumar _Profile
Pradeep Kumar _ProfilePradeep Kumar
 

Similar to Using Swift Enums for safer UICollectionViews and UITableViews (20)

iOS Programming 101
iOS Programming 101iOS Programming 101
iOS Programming 101
 
Evolve 19 | Gordon Pike | Prepping for Tomorrow - Creating a Flexible AEM Arc...
Evolve 19 | Gordon Pike | Prepping for Tomorrow - Creating a Flexible AEM Arc...Evolve 19 | Gordon Pike | Prepping for Tomorrow - Creating a Flexible AEM Arc...
Evolve 19 | Gordon Pike | Prepping for Tomorrow - Creating a Flexible AEM Arc...
 
Serverless operations for the iRobot fleet
Serverless operations for the iRobot fleetServerless operations for the iRobot fleet
Serverless operations for the iRobot fleet
 
iOS Testing With Appium at Gilt
iOS Testing With Appium at GiltiOS Testing With Appium at Gilt
iOS Testing With Appium at Gilt
 
Industrial manufacturing and IFS Applications 8: customer case
Industrial manufacturing and IFS Applications 8: customer caseIndustrial manufacturing and IFS Applications 8: customer case
Industrial manufacturing and IFS Applications 8: customer case
 
Automate REST API Testing
Automate REST API TestingAutomate REST API Testing
Automate REST API Testing
 
Good bye Massive View Controller!
Good bye Massive View Controller!Good bye Massive View Controller!
Good bye Massive View Controller!
 
iOS apps in Swift
iOS apps in SwiftiOS apps in Swift
iOS apps in Swift
 
INTERFACE by apidays_Recommendations for API Governance and an API Economy Ce...
INTERFACE by apidays_Recommendations for API Governance and an API Economy Ce...INTERFACE by apidays_Recommendations for API Governance and an API Economy Ce...
INTERFACE by apidays_Recommendations for API Governance and an API Economy Ce...
 
Sencha Auckland Conference (SenchaCon) AdvanceRetail Presentation
Sencha Auckland Conference (SenchaCon) AdvanceRetail PresentationSencha Auckland Conference (SenchaCon) AdvanceRetail Presentation
Sencha Auckland Conference (SenchaCon) AdvanceRetail Presentation
 
Building front-end apps that Scale - FOSDEM 2014
Building front-end apps that Scale - FOSDEM 2014Building front-end apps that Scale - FOSDEM 2014
Building front-end apps that Scale - FOSDEM 2014
 
Learnings for Accessibility for iOS Platform
Learnings for Accessibility for iOS PlatformLearnings for Accessibility for iOS Platform
Learnings for Accessibility for iOS Platform
 
AEM 6.0 Touch-optimized UI
AEM 6.0 Touch-optimized UIAEM 6.0 Touch-optimized UI
AEM 6.0 Touch-optimized UI
 
ARIS World
ARIS World ARIS World
ARIS World
 
App Development with Apple Swift Certification at Certiport Centers
App Development with Apple Swift Certification at Certiport CentersApp Development with Apple Swift Certification at Certiport Centers
App Development with Apple Swift Certification at Certiport Centers
 
How to Assure Performance in Hybrid Cloud Ecosystems
How to Assure Performance in Hybrid Cloud EcosystemsHow to Assure Performance in Hybrid Cloud Ecosystems
How to Assure Performance in Hybrid Cloud Ecosystems
 
Building your first iOS app using Xamarin
Building your first iOS app using XamarinBuilding your first iOS app using Xamarin
Building your first iOS app using Xamarin
 
iPhone Camp Birmingham (Bham) - Intro To iPhone Development
iPhone Camp Birmingham (Bham) - Intro To iPhone DevelopmentiPhone Camp Birmingham (Bham) - Intro To iPhone Development
iPhone Camp Birmingham (Bham) - Intro To iPhone Development
 
EVOLVE'15 | Maximize | Ted Billups | Taming AEM
EVOLVE'15 | Maximize | Ted Billups | Taming AEMEVOLVE'15 | Maximize | Ted Billups | Taming AEM
EVOLVE'15 | Maximize | Ted Billups | Taming AEM
 
Pradeep Kumar _Profile
Pradeep Kumar _ProfilePradeep Kumar _Profile
Pradeep Kumar _Profile
 

Recently uploaded

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 

Recently uploaded (20)

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 

Using Swift Enums for safer UICollectionViews and UITableViews