SlideShare una empresa de Scribd logo
1 de 24
Descargar para leer sin conexión
iOS Development Best
Practices
Tony Collins - Lead iOS developer
Jonathan Winger-Lang - iOS developer
“A bad workman blames his tools”
Before you start coding anything, make sure you
have the right tools available!
IDE……… Xcode
API testing/POST/GET
Postman - Is handy when collaborating across a few developers
as requests can be exported/saved (including header info).
Downside - requires Chrome = Memory Beast
CocoaRestClient - Super lightweight, native

OSX app. Does most things Postman can.

My personal choice.
API testing TCP/HTTP
Charles - Really powerful HTTP proxy that allows you to actually
see the traffic your app is sending/receiving in real time. Possible
to spoof your SSL cert in order to see encrypted traffic. 

Downside - Costs $50 (worth it though)
Wireshark - Allows you to intercept traffic going to/from your app
and analyse the packet contents/HTTP headers etc. Globally
recognised as the number 1 opensource app for this job.

Downside - Requires a fair amount of set up (which can be a little
intimidating)
Automation tools
Automator - Seriously underused/underrated app packaged with
every build of OSX
Great to do batch tasks e.g. Change 100 images to a
specific size
Visually build complex shell scripts and mix in AppleScript or
whatever you need
Fastlane/deliver - Takes the pain out of uploading metadata and
screenshots to iTunes connect
What took days now takes 6 minutes!!
SQLite (Looking at your DB)
SQLPro - Native OSX app. Most stable and reliable I have found. 

Downside - costs $10
SQLiteManager - Browser plug in for FireFox

Downside - lacks quality of dedicated app
Planning
Proper Preparation Prevents Poor Performance
AGILE (Just a few basics)
Create ‘user stories’ from the specification
Be Data driven - Gut feeling will only get you so far!!!!!
Be user driven - What do your users want ?
Be Involved - Don’t be shy, have an opinion, use your knowledge
to advance the idea. Spot flaws NOW, not 1 month down the line.
You will save yourself time, money and a lot of headaches.
Iterate - Check, Do, Check, Change
Time to start coding (nearly)
Get an API spec!
Get the wireframes!!
Get a logic flowchart!!!
Get the designs/assets/brand guidelines!!!!
Research any third party tools!!!!!
Which Design Pattern ?
Whilst analysing the wireframes, look for View Controllers that
have a common theme.
Spot repeating elements - multiple payment options e.g. Linepay,
Alipay, Paypal - can we link them ?
Think long term. This is a project you may have to deal with in 12
months time. Do yourself a favour and make the right decisions
now.
Facade pattern
Keeps the API’s normalised
Hides complexity behind a simple method
Makes it easier to refactor code
Facade - Example
2 API’s which are used when a payment is made - no
matter what the source (PayPal, Linepay etc)
Facade - Example
Hides this complexity
Singleton - Good and Bad
Ask yourself these questions:
“Does the object need to be referenced by multiple other objects at
the same time e.g. needs to be ‘Thread safe’ ?“
“Does the current ‘state’ need to be always up to date when
referenced ?”
“Is there a risk that if a duplicate object is created, the calling object
might be pointing at the wrong object?”
If yes to all of these - USE A SINGLETON!
Category pattern
Very useful for keeping your code DRY
Easy to change a single method than same method
multiple times
Delegate vs Notifications
Use a delegate pattern if it is only a single object that
cares about the event
Use NSNotifications when you need more then one
object to know about the event
Delegates allow you to have more transparent objects
as you can specify @required @optional
NSCoding
Allows custom objects to be persisted and retrieved
later
Can store custom objects in .bin files or to places such
as NSUserDefaults
Daily Coding tips
D.R.Y - Dont Repeat Yourself
The patterns mentioned will naturally force you to be D.R.Y
It will become a natural part of your refactoring
Don’t do magic to achieve D.R.Y
Unit Testing
Try and add unit tests from the beginning of a project. Retrofitting unit
tests can be painful .
Great new UITesting tools in Xcode 7
Daily Coding tips
Comments + Verbose method names
COMMENT YOUR CODE - NO EXCUSES
Saves 1000’s of man hours
Is just common courtesy
Name of method should explain what it does
Add a comment in the .h advising what the class does
Daily Coding tips
Prototype
Great to show stakeholders (Storyboards designed for it)
Can trust implementation without the ‘noise’ of existing code
Can help spot issues earlier
Use continuous integration tools
Apple Bots - preferred as made by Apple although Travis
and Jenkins (free) are good
Daily Coding tips
Final tips…
Keep your project organised
Git - Commit little and often
Dont be an ‘end of the day’ committer
Get into the habit even when working solo
Commit should reflect what was actually done
Do pair programming - Make it 20% of your weekly schedule
Text
ENJOY CODING!!!
Any questions ?

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

Aspect oriented programming
Aspect oriented programmingAspect oriented programming
Aspect oriented programming
 
BDD with SpecFlow and Selenium
BDD with SpecFlow and SeleniumBDD with SpecFlow and Selenium
BDD with SpecFlow and Selenium
 
Contributing to open source
Contributing to open sourceContributing to open source
Contributing to open source
 
Cypress vs Selenium WebDriver: Better, Or Just Different? -- by Gil Tayar
Cypress vs Selenium WebDriver: Better, Or Just Different? -- by Gil TayarCypress vs Selenium WebDriver: Better, Or Just Different? -- by Gil Tayar
Cypress vs Selenium WebDriver: Better, Or Just Different? -- by Gil Tayar
 
Tech Talk Tokyo #2 tetsuya matsuzawa
Tech Talk Tokyo #2 tetsuya matsuzawaTech Talk Tokyo #2 tetsuya matsuzawa
Tech Talk Tokyo #2 tetsuya matsuzawa
 
React Native
React NativeReact Native
React Native
 
When to (use / not use) React Native.
When to (use / not use) React Native.When to (use / not use) React Native.
When to (use / not use) React Native.
 
Алексей Волков "Введение в React Native"
Алексей Волков "Введение в React Native"Алексей Волков "Введение в React Native"
Алексей Волков "Введение в React Native"
 
Google App Engine - Java Style
Google App Engine - Java StyleGoogle App Engine - Java Style
Google App Engine - Java Style
 
Test driven development v1.0
Test driven development v1.0Test driven development v1.0
Test driven development v1.0
 
Cypress workshop for JSFoo 2019
Cypress  workshop for JSFoo 2019Cypress  workshop for JSFoo 2019
Cypress workshop for JSFoo 2019
 
Angle Forward with TypeScript
Angle Forward with TypeScriptAngle Forward with TypeScript
Angle Forward with TypeScript
 
Angular from a Different Angle
Angular from a Different AngleAngular from a Different Angle
Angular from a Different Angle
 
06 integrating extra features and looking forward
06   integrating extra features and looking forward06   integrating extra features and looking forward
06 integrating extra features and looking forward
 
Nativescript
NativescriptNativescript
Nativescript
 
DSL, Page Object and WebDriver – the path to reliable functional tests.pptx
DSL, Page Object and WebDriver – the path to reliable functional tests.pptxDSL, Page Object and WebDriver – the path to reliable functional tests.pptx
DSL, Page Object and WebDriver – the path to reliable functional tests.pptx
 
Top java script frameworks ppt
Top java script frameworks pptTop java script frameworks ppt
Top java script frameworks ppt
 
Intro to react native
Intro to react nativeIntro to react native
Intro to react native
 
Intro to Service Worker API and its use cases
Intro to Service Worker API and its use casesIntro to Service Worker API and its use cases
Intro to Service Worker API and its use cases
 
An iOS Developer's Perspective on React Native
An iOS Developer's Perspective on React NativeAn iOS Developer's Perspective on React Native
An iOS Developer's Perspective on React Native
 

Destacado

Business_Summary_Alive_Automations (1)
Business_Summary_Alive_Automations (1)Business_Summary_Alive_Automations (1)
Business_Summary_Alive_Automations (1)
Kushagra Choudhary
 

Destacado (8)

Business_Summary_Alive_Automations (1)
Business_Summary_Alive_Automations (1)Business_Summary_Alive_Automations (1)
Business_Summary_Alive_Automations (1)
 
Sophie Angus Unit 35 LO2
Sophie Angus Unit 35 LO2Sophie Angus Unit 35 LO2
Sophie Angus Unit 35 LO2
 
Webinář: Co nového přináší verze 9 jedničky v zálohování Veeam Backup & Repli...
Webinář: Co nového přináší verze 9 jedničky v zálohování Veeam Backup & Repli...Webinář: Co nového přináší verze 9 jedničky v zálohování Veeam Backup & Repli...
Webinář: Co nového přináší verze 9 jedničky v zálohování Veeam Backup & Repli...
 
Presentazione Tambeach
Presentazione Tambeach Presentazione Tambeach
Presentazione Tambeach
 
Creating a Culture of Innovation in Your Library and Community (SWKLS)
Creating a Culture of Innovation in Your Library and Community (SWKLS)Creating a Culture of Innovation in Your Library and Community (SWKLS)
Creating a Culture of Innovation in Your Library and Community (SWKLS)
 
Frankl Viktor Logoterapia Teorias de la personalidad
Frankl Viktor Logoterapia Teorias de la personalidadFrankl Viktor Logoterapia Teorias de la personalidad
Frankl Viktor Logoterapia Teorias de la personalidad
 
Alternative currencies
Alternative currenciesAlternative currencies
Alternative currencies
 
Metsätilaston palvelut elinkeinoelämän näkökulmasta - Simo jaakkola, Koneyrit...
Metsätilaston palvelut elinkeinoelämän näkökulmasta - Simo jaakkola, Koneyrit...Metsätilaston palvelut elinkeinoelämän näkökulmasta - Simo jaakkola, Koneyrit...
Metsätilaston palvelut elinkeinoelämän näkökulmasta - Simo jaakkola, Koneyrit...
 

Similar a iOS development best practices

Building an Open Source iOS app: lessons learned
Building an Open Source iOS app: lessons learnedBuilding an Open Source iOS app: lessons learned
Building an Open Source iOS app: lessons learned
Wojciech Koszek
 
564 Class Notes July 27, 2010
564 Class Notes July 27, 2010564 Class Notes July 27, 2010
564 Class Notes July 27, 2010
Stephanie Magleby
 

Similar a iOS development best practices (20)

Computer software specialists wikki verma
Computer software specialists   wikki vermaComputer software specialists   wikki verma
Computer software specialists wikki verma
 
Cinci ug-january2011-anti-patterns
Cinci ug-january2011-anti-patternsCinci ug-january2011-anti-patterns
Cinci ug-january2011-anti-patterns
 
iPhone App from concept to product
iPhone App from concept to productiPhone App from concept to product
iPhone App from concept to product
 
System design for Web Application
System design for Web ApplicationSystem design for Web Application
System design for Web Application
 
Architecting a Large Software Project - Lessons Learned
Architecting a Large Software Project - Lessons LearnedArchitecting a Large Software Project - Lessons Learned
Architecting a Large Software Project - Lessons Learned
 
Publishing strategies for API documentation
Publishing strategies for API documentationPublishing strategies for API documentation
Publishing strategies for API documentation
 
Building an Open Source iOS app: lessons learned
Building an Open Source iOS app: lessons learnedBuilding an Open Source iOS app: lessons learned
Building an Open Source iOS app: lessons learned
 
Debugging
DebuggingDebugging
Debugging
 
30 days or less: New Features to Production
30 days or less: New Features to Production30 days or less: New Features to Production
30 days or less: New Features to Production
 
DocOps: Documentation at the Speed of Agile
DocOps: Documentation at the Speed of AgileDocOps: Documentation at the Speed of Agile
DocOps: Documentation at the Speed of Agile
 
564 Class Notes July 27, 2010
564 Class Notes July 27, 2010564 Class Notes July 27, 2010
564 Class Notes July 27, 2010
 
Automation and machine learning in the enterprise
Automation and machine learning in the enterpriseAutomation and machine learning in the enterprise
Automation and machine learning in the enterprise
 
Workshop - The Little Pattern That Could.pdf
Workshop - The Little Pattern That Could.pdfWorkshop - The Little Pattern That Could.pdf
Workshop - The Little Pattern That Could.pdf
 
Learning to be IDE Free (PrDC 2015)
Learning to be IDE Free (PrDC 2015)Learning to be IDE Free (PrDC 2015)
Learning to be IDE Free (PrDC 2015)
 
PHP Mega Meetup, Sep, 2020, Anti patterns in php
PHP Mega Meetup, Sep, 2020, Anti patterns in phpPHP Mega Meetup, Sep, 2020, Anti patterns in php
PHP Mega Meetup, Sep, 2020, Anti patterns in php
 
The Final Frontier
The Final FrontierThe Final Frontier
The Final Frontier
 
Learning Web Development with Ruby on Rails Launch
Learning Web Development with Ruby on Rails LaunchLearning Web Development with Ruby on Rails Launch
Learning Web Development with Ruby on Rails Launch
 
GoF Design patterns I: Introduction + Structural Patterns
GoF Design patterns I:   Introduction + Structural PatternsGoF Design patterns I:   Introduction + Structural Patterns
GoF Design patterns I: Introduction + Structural Patterns
 
Managing Phone Dev Projects
Managing Phone Dev ProjectsManaging Phone Dev Projects
Managing Phone Dev Projects
 
The "Holy Grail" of Dev/Ops
The "Holy Grail" of Dev/OpsThe "Holy Grail" of Dev/Ops
The "Holy Grail" of Dev/Ops
 

Más de Michal Juhas

Más de Michal Juhas (15)

Tech Mind Maps - Booklet Preview
Tech Mind Maps - Booklet PreviewTech Mind Maps - Booklet Preview
Tech Mind Maps - Booklet Preview
 
IT Recruiter's Mind Maps - Booklet Preview
IT Recruiter's Mind Maps - Booklet PreviewIT Recruiter's Mind Maps - Booklet Preview
IT Recruiter's Mind Maps - Booklet Preview
 
Three Secret Ingredients To Recruiting Software Developers
Three Secret Ingredients To Recruiting Software DevelopersThree Secret Ingredients To Recruiting Software Developers
Three Secret Ingredients To Recruiting Software Developers
 
What i wish i knew in my 20's
What i wish i knew in my 20'sWhat i wish i knew in my 20's
What i wish i knew in my 20's
 
Adaptive Upskill As The Future Of The Workforce
Adaptive Upskill As The Future Of The WorkforceAdaptive Upskill As The Future Of The Workforce
Adaptive Upskill As The Future Of The Workforce
 
Introducing PlanetQuest on the TechsSmmit 2018
Introducing PlanetQuest on the TechsSmmit 2018Introducing PlanetQuest on the TechsSmmit 2018
Introducing PlanetQuest on the TechsSmmit 2018
 
Metasearch Outlook 2017
Metasearch Outlook 2017Metasearch Outlook 2017
Metasearch Outlook 2017
 
Subscription Economy: How to shift mindset in 2017 and adapt to changing cons...
Subscription Economy: How to shift mindset in 2017 and adapt to changing cons...Subscription Economy: How to shift mindset in 2017 and adapt to changing cons...
Subscription Economy: How to shift mindset in 2017 and adapt to changing cons...
 
How do we test nodejs apps?
How do we test nodejs apps?How do we test nodejs apps?
How do we test nodejs apps?
 
A walkthrough of JavaScript ES6 features
A walkthrough of JavaScript ES6 featuresA walkthrough of JavaScript ES6 features
A walkthrough of JavaScript ES6 features
 
Becoming Data Driven
Becoming Data DrivenBecoming Data Driven
Becoming Data Driven
 
Productive Android developers (Meetup slides)
Productive Android developers (Meetup slides)Productive Android developers (Meetup slides)
Productive Android developers (Meetup slides)
 
Building Scalable Micro-services with Nodejs
Building Scalable Micro-services with NodejsBuilding Scalable Micro-services with Nodejs
Building Scalable Micro-services with Nodejs
 
Lessons Learnt from Backend Systems Development
Lessons Learnt from Backend Systems DevelopmentLessons Learnt from Backend Systems Development
Lessons Learnt from Backend Systems Development
 
HotelQuickly Product & Engineering
HotelQuickly Product & EngineeringHotelQuickly Product & Engineering
HotelQuickly Product & Engineering
 

Último

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 

Último (20)

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
 
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
 
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
 
[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
 
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...
 
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
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
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
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
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
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
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...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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
 

iOS development best practices

  • 1. iOS Development Best Practices Tony Collins - Lead iOS developer Jonathan Winger-Lang - iOS developer
  • 2. “A bad workman blames his tools” Before you start coding anything, make sure you have the right tools available!
  • 4. API testing/POST/GET Postman - Is handy when collaborating across a few developers as requests can be exported/saved (including header info). Downside - requires Chrome = Memory Beast CocoaRestClient - Super lightweight, native
 OSX app. Does most things Postman can.
 My personal choice.
  • 5. API testing TCP/HTTP Charles - Really powerful HTTP proxy that allows you to actually see the traffic your app is sending/receiving in real time. Possible to spoof your SSL cert in order to see encrypted traffic. 
 Downside - Costs $50 (worth it though) Wireshark - Allows you to intercept traffic going to/from your app and analyse the packet contents/HTTP headers etc. Globally recognised as the number 1 opensource app for this job.
 Downside - Requires a fair amount of set up (which can be a little intimidating)
  • 6. Automation tools Automator - Seriously underused/underrated app packaged with every build of OSX Great to do batch tasks e.g. Change 100 images to a specific size Visually build complex shell scripts and mix in AppleScript or whatever you need Fastlane/deliver - Takes the pain out of uploading metadata and screenshots to iTunes connect What took days now takes 6 minutes!!
  • 7. SQLite (Looking at your DB) SQLPro - Native OSX app. Most stable and reliable I have found. 
 Downside - costs $10 SQLiteManager - Browser plug in for FireFox
 Downside - lacks quality of dedicated app
  • 9. AGILE (Just a few basics) Create ‘user stories’ from the specification Be Data driven - Gut feeling will only get you so far!!!!! Be user driven - What do your users want ? Be Involved - Don’t be shy, have an opinion, use your knowledge to advance the idea. Spot flaws NOW, not 1 month down the line. You will save yourself time, money and a lot of headaches. Iterate - Check, Do, Check, Change
  • 10. Time to start coding (nearly) Get an API spec! Get the wireframes!! Get a logic flowchart!!! Get the designs/assets/brand guidelines!!!! Research any third party tools!!!!!
  • 11. Which Design Pattern ? Whilst analysing the wireframes, look for View Controllers that have a common theme. Spot repeating elements - multiple payment options e.g. Linepay, Alipay, Paypal - can we link them ? Think long term. This is a project you may have to deal with in 12 months time. Do yourself a favour and make the right decisions now.
  • 12. Facade pattern Keeps the API’s normalised Hides complexity behind a simple method Makes it easier to refactor code
  • 13. Facade - Example 2 API’s which are used when a payment is made - no matter what the source (PayPal, Linepay etc)
  • 14. Facade - Example Hides this complexity
  • 15. Singleton - Good and Bad Ask yourself these questions: “Does the object need to be referenced by multiple other objects at the same time e.g. needs to be ‘Thread safe’ ?“ “Does the current ‘state’ need to be always up to date when referenced ?” “Is there a risk that if a duplicate object is created, the calling object might be pointing at the wrong object?” If yes to all of these - USE A SINGLETON!
  • 16. Category pattern Very useful for keeping your code DRY Easy to change a single method than same method multiple times
  • 17. Delegate vs Notifications Use a delegate pattern if it is only a single object that cares about the event Use NSNotifications when you need more then one object to know about the event Delegates allow you to have more transparent objects as you can specify @required @optional
  • 18. NSCoding Allows custom objects to be persisted and retrieved later Can store custom objects in .bin files or to places such as NSUserDefaults
  • 19. Daily Coding tips D.R.Y - Dont Repeat Yourself The patterns mentioned will naturally force you to be D.R.Y It will become a natural part of your refactoring Don’t do magic to achieve D.R.Y Unit Testing Try and add unit tests from the beginning of a project. Retrofitting unit tests can be painful . Great new UITesting tools in Xcode 7
  • 20. Daily Coding tips Comments + Verbose method names COMMENT YOUR CODE - NO EXCUSES Saves 1000’s of man hours Is just common courtesy Name of method should explain what it does Add a comment in the .h advising what the class does
  • 21. Daily Coding tips Prototype Great to show stakeholders (Storyboards designed for it) Can trust implementation without the ‘noise’ of existing code Can help spot issues earlier Use continuous integration tools Apple Bots - preferred as made by Apple although Travis and Jenkins (free) are good
  • 22. Daily Coding tips Final tips… Keep your project organised Git - Commit little and often Dont be an ‘end of the day’ committer Get into the habit even when working solo Commit should reflect what was actually done Do pair programming - Make it 20% of your weekly schedule