1. Developing for iOS
Some of the practices
Oleksandr Lobunets
oleksandr.lobunets@fit.fraunhofer.de
Sunday, October 28, 12
2. Outline
Background
Recommended resources
The Practices
Q&A
Sunday, October 28, 12
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. Background
In the industry
Sunday, October 28, 12
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. 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. Blogs, links, etc
Apple Documentation
http://www.cocoawithlove.com/
http://www.beginningiosdev.com/
Stackoverflow ;)
etc
Sunday, October 28, 12
8. Dilemma
How to share the experience?
Sunday, October 28, 12
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. 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. 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. 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 (!)
Examples
Sunday, October 28, 12
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 / Distribution
Sunday, October 28, 12
18. Collaborative work
Versioning system: Git
(already covered in the lectures)
You already use Github
What about keeping privacy?
Sunday, October 28, 12
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-repository
Sunday, October 28, 12
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. 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
replacement
Sunday, October 28, 12
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 doesn't 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-nslog
Sunday, October 28, 12
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. App template/framework
Xcode built-in templates
Usage of Storyboards
3rd party framework
PureMVC, Three20, Cocos2D/3D, etc
Sunday, October 28, 12
26. Data persistence
Files
UserDefaults (preferences)
SQLite
CoreData
Sunday, October 28, 12
27. Networking
Reachability Framework
(https://github.com/tonymillion/Reachability)
Great way to check network connectivity (UX!)
Impacts on how you organize your app logic
Sunday, October 28, 12
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 backend
Sunday, October 28, 12
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. Test/Debug
Testing (unit testing, functional, system/ui)
Debugging (1st element - logs, tools,
simulator vs device debugging - location
debugging)
Sunday, October 28, 12
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, etc
Sunday, October 28, 12
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. Q&A
Oleksandr Lobunets
oleksandr.lobunets@fit.fraunhofer.de
Sunday, October 28, 12