iOS Development. Some practices.

1,092 views

Published on

A lecture in KU Leuven.

Published in: Education
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,092
On SlideShare
0
From Embeds
0
Number of Embeds
7
Actions
Shares
0
Downloads
0
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

iOS Development. Some practices.

  1. 1. Developing for iOS Some of the practices Oleksandr Lobunets oleksandr.lobunets@fit.fraunhofer.deSunday, October 28, 12
  2. 2. Outline Background Recommended resources The Practices Q&ASunday, October 28, 12
  3. 3. Background Academical National Technical University of Ukraine “KPI”, Institute of Physics & Technology. (1998 - 2004) B.S. / M.S. in Applied Mathematics National Space Agency of Ukraine, Space Research Institute. (2003 - 2006) Junior Researcher RWTH Aachen, B-IT. (2007 - 2010) M.S. in Media Informatics Fraunhofer FIT, CSCW Group (2010 - now)Sunday, October 28, 12
  4. 4. Background In the industrySunday, October 28, 12
  5. 5. Recommended resources iTunes-U Famous Stanford’s “iPhone Application Development” (2009 is probably too outdated) RWTH Aachen “iPhone Application Development” (Jan Borchers)Sunday, October 28, 12
  6. 6. Some books... iPhone SDK Development Building iPhone Applications by Bill Dudney Chris Adamson Core Data Apple’s API for Persisting Data under Mac OS X by Marcus S. Zarra Pro iOS Table Views for iPhone, iPad, and iPod Touch by Tim Duckett Pro iOS 5 Augmented Reality by Kyle Roche There’re much, much more!Sunday, October 28, 12
  7. 7. Blogs, links, etc Apple Documentation http://www.cocoawithlove.com/ http://www.beginningiosdev.com/ Stackoverflow ;) etcSunday, October 28, 12
  8. 8. Dilemma How to share the experience?Sunday, October 28, 12
  9. 9. A fictional project!Sunday, October 28, 12
  10. 10. A fictional project Generalizes all non-functional requirements from your assignments (as far as I could guess from your blogs) Complete iOS application lifecycle overview (well, almost complete) Just general overview of the process & some of the practices (too less time for the details)Sunday, October 28, 12
  11. 11. Recall from SE DIA? Iterative incremental development? Agile development? What else do you remember from classes interactive system design and software engineering?Sunday, October 28, 12
  12. 12. The flow: Product Steps Idea, developing the vision Market/competitors analysis (sounds very loud) End up with MVP Develop the PRD (well, sounds too enterprise/corporate) But meanwhile you just want to write some code? (Yes, you can. It’s called writing spikes - in other language - minimizing technical risks)Sunday, October 28, 12
  13. 13. The flow: Prototyping Accompanies the product activities Next - Prototyping (remember DIA?) From Lo-Fi to Hi-Fi Prototyping tools (paper, balsamiq, omnigraffle, graffletopia, keynote, etc) Graphical resources (!) ExamplesSunday, October 28, 12
  14. 14. Example: BalsamiqSunday, October 28, 12
  15. 15. Example: OmniGraffleSunday, October 28, 12
  16. 16. Example: KeynoteSunday, October 28, 12
  17. 17. The flow: Engineering Now it comes to programming The key points to focus as an engineer are: Collaborative work on code Some notes on memory management Logging in your code The foundation for your UI Picking the application template/framework Persistence of your data Networking Backend Testing / Debugging / Builds / CI / DistributionSunday, October 28, 12
  18. 18. Collaborative work Versioning system: Git (already covered in the lectures) You already use Github What about keeping privacy?Sunday, October 28, 12
  19. 19. Collaborative work +Sunday, October 28, 12
  20. 20. + Create a “bare” repo in the Dropbox folder Checkout to your working folder or ...add remote file://$HOME/Dropbox/your_repo Share the Dropbox folder PROFIT! http://tumblr.intranation.com/post/766290743/using-dropbox-git-repositorySunday, October 28, 12
  21. 21. Memory management First decide which iOS version you want to support Manual memory management (retain/release manually) Automatic Reference Counting (ARC) Introduced in iOS5 Works in iOS4 (limited)Sunday, October 28, 12
  22. 22. Logging NSLog(...) How to drop it in the release builds? Why? ;) Custom conditional logging classes vs macros Go for macro :) as the almost a drop in replacementSunday, October 28, 12
  23. 23. Logging Add to your <AppName>_Prefix.pch file: #ifdef DEBUG # define DLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__); #else # define DLog(...) #endif // ALog always displays output regardless of the DEBUG setting #define ALog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__); Usage DLog(); DLog(@"here"); DLog(@"value: %d", x); // Unfortunately this doesnt work DLog(aStringVariable); // you have to do this instead: DLog(@"%@", aStringVariable); Set preprocessor flags (DEBUG/DDEBUG) http://iphoneincubator.com/blog/debugging/the-evolution-of-a-replacement-for-nslogSunday, October 28, 12
  24. 24. UI foundation Decision based on your hi-fi prototypes Standard elements (UIKit, additionally some high level libraries, keep you stick to HUG, still possible to violate) Non-standard (UIKit, custom libraries, program your UIView, relies heavily on graphical resources, custom drawing. Think about UX. Usage of 2D game frameworks) 3D (GLView, custom Open GL SE programming, use existing3D engines, license vs efforts costs)Sunday, October 28, 12
  25. 25. App template/framework Xcode built-in templates Usage of Storyboards 3rd party framework PureMVC, Three20, Cocos2D/3D, etcSunday, October 28, 12
  26. 26. Data persistence Files UserDefaults (preferences) SQLite CoreDataSunday, October 28, 12
  27. 27. Networking Reachability Framework (https://github.com/tonymillion/Reachability) Great way to check network connectivity (UX!) Impacts on how you organize your app logicSunday, October 28, 12
  28. 28. Networking Dealing with RESTful XML/JSON APIs RestKit (http://restkit.org/) RESTFramework (https://github.com/ivasic/RESTframework) SBJSON (http://stig.github.com/json-framework/) There’s a number of choices The selection depends on the backendSunday, October 28, 12
  29. 29. Backend Custom vs SaaS Custom Pick your favorite stack and deploy to PaaS/IaaS) Example: Python/Django/Tastypie on dotCloud/Heroku SaaS http://www.slideshare.net/raminf/iphone-backend-servers All in one DataKit (Node.js/MongoDB) https://github.com/eaigner/DataKit Another example: http://www.apiomat.com/Sunday, October 28, 12
  30. 30. Test/Debug Testing (unit testing, functional, system/ui) Debugging (1st element - logs, tools, simulator vs device debugging - location debugging)Sunday, October 28, 12
  31. 31. Build/Distribute Building locally & distributing manually Distribute via Email, Dropbox, etc Continuous Integration (CI) Centralized build with CI server Centralized publishing/distribution Running tests, gathering metrics, etcSunday, October 28, 12
  32. 32. Build/Distribute “Jenkins is an open-source continuous integration server with 300+ plugins to support all kinds of software development” Standard de facto Resources on how to configure: http://zanshin.net/2012/02/27/setup-jenkins-for-ios-builds/ http://eclipsesource.com/blogs/2012/06/01/ups-and-downs- with-continuous-integration-for-ios-apps-jenkins-xcode- cobertura-and-testflight/Sunday, October 28, 12
  33. 33. Q&A Oleksandr Lobunets oleksandr.lobunets@fit.fraunhofer.deSunday, October 28, 12

×