Developing for iOS - When to do what and how
@martincronje
[email protected]
Slide 2
Slide 2 text
agenda
Slide 3
Slide 3 text
the market
Slide 4
Slide 4 text
7 billion mobile phones
Slide 5
Slide 5 text
1,5 billion smartphones
Slide 6
Slide 6 text
No content
Slide 7
Slide 7 text
why iOS?
Slide 8
Slide 8 text
Android won, right?
Slide 9
Slide 9 text
Android has 75% market share
Slide 10
Slide 10 text
Platform
Mobile OS
2013[a]
Mobile OS
2017[a]
App
downloads
2013[b]
Web usage
2013[c]
3.9% 10.2% 3.7% 1.5%
16.9% 17.9% 47.8% 54.91%
75.3% 68.3% 48.6% 25.7%
3.9% 3.6% - 17,89%
Target platform (Global market share)?
a) IDC Worldwide Mobile Phone Tracker, June 6, 2012
b) XYO Global App Download Reports 1.0
c) NetMarketShare Mobile Operating System Aug 2013
…
Slide 11
Slide 11 text
No content
Slide 12
Slide 12 text
No content
Slide 13
Slide 13 text
No content
Slide 14
Slide 14 text
native vs. hybrid vs. web
Slide 15
Slide 15 text
When you want the worst of both...
Hybrid:
Slide 16
Slide 16 text
!= !=
Hybrid…
Slide 17
Slide 17 text
“The biggest mistake we’ve made as a
company is betting on HTML5 over native.”
Mark Zuckerberg
Slide 18
Slide 18 text
When you want to extend your phone...
Native:
Slide 19
Slide 19 text
When you want cost-effective...
Web:
Slide 20
Slide 20 text
Approach characteristics
User
Experience
Device
Access
Works
offline
Cost of
ownership
Reach
Native Highest Yes Yes Highest Specific
Cross Platform High Yes * Yes * High ** Common *
Hybrid Low Yes * Partially * Medium ** Common *
Web (Rich) Low Limited No Low 30%
Web (Light) Lowest None No Lowest 80%
* Depends on framework and approach chosen.
** Depending on support offered by relevant platform
Slide 21
Slide 21 text
becoming an iOS developer
Slide 22
Slide 22 text
Developing Apps for iPhone and iPad
(Winter 2013)
Slide 23
Slide 23 text
No content
Slide 24
Slide 24 text
No content
Slide 25
Slide 25 text
my setup
Slide 26
Slide 26 text
My setup
MacBook Pro 15”
(Retina Display, 8GB RAM, i7, SSD)
OSX Mountain Lion 10.8.4 Windows 8
Xcode / AppCode
Xamarin Studio
Visual Studio 2012
Xamarin Studio
VMWare
Fusion
Slide 27
Slide 27 text
My software on OSX
IDE Xcode, AppCode and Xamarin Studio
Editors vi and Sublime
Shell iTerm, zsh and oh-my-zsh
Misc Homebrew, Alfred, AirMail, Fanstical and 1Password
Literals
NSNumber *number;!
!
number = [NSNumber numberWithChar:'X'];!
number = [NSNumber numberWithInt:12345];!
number = [NSNumber numberWithUnsignedLong:12345ul];!
number = [NSNumber numberWithLongLong:12345ll];!
number = [NSNumber numberWithFloat:123.45f];!
number = [NSNumber numberWithDouble:123.45];!
number = [NSNumber numberWithBool:YES];!
number = @'X’;!
number = @12345;!
number = @12345ul;!
number = @12345ll;!
number = @123.45f;!
number = @123.45;!
number = @YES;!
Some other tips
• Information hiding
• Singletons and dependency injection
Slide 47
Slide 47 text
Frameworks
Slide 48
Slide 48 text
Cocoapods
$ gem install cocoapods!
$ cat Podfile!
platform :ios, :deployment_target => '6.0'!
pod 'AFNetworking'!
pod 'Objection'!
pod 'Facebook-iOS-SDK'!
pod 'OCHamcrest'!
!
$ pod setup!
Slide 49
Slide 49 text
Frank
Feature: General (Main)!
Scenario: My details!
!
Given I logged in with "my-user-1" !
And I wait for "Logging in…" to go away!
When I touch the "My Details" table cell!
Then I wait to see a navigation bar titled "My Details"!
And I should see a table containing the following:!
| Column 1 |!
| Username | !
| Email |!
| First Name |!
...!
When I type "Martin" into the Username text field!
And I ...!
Slide 50
Slide 50 text
Frank
Then /^I wait to see a navigation bar titled "([^\"]*)"$/ do |expected_mark|!
quote = get_selector_quote(expected_mark)!
message = "waited to see a navigation bar titled #{quote}#{expected_mark}#{quote}"!
wait_until( :timeout => 30, :message => message) {!
element_exists( "navigationItemView marked:#{quote}#{expected_mark}#{quote}" )!
}!
end!
!
When /^I touch the "([^\"]*)" table cell$/ do |name|!
touch("tableView view marked:'#{name}'")!
end!
!
When /^I type "([^"]*)" into the ([^"]*) text field$/ do |value, field|!
selector = "label marked:'#{field}' parent tableViewCell textField"!
text_fields_modified = frankly_map(selector, "setText:", value )!
raise "could not find text fields to update" if text_fields_modified.empty?!
end!
Slide 51
Slide 51 text
Frank
Then /^I should see a table containing the following:$/ do |table|!
!
table.rows.each do |row|!
selector = String.new!
!
row.each do |cell|!
if selector.empty?!
selector = "tableView view marked:'#{cell}'"!
else!
selector << " parent tableViewCell view marked:'#{cell}'"!
end!
end!
check_element_exists( selector )!
end!
end!
Slide 52
Slide 52 text
No content
Slide 53
Slide 53 text
mono vs objective-c
Slide 54
Slide 54 text
Development platform
Platform IDE SDK Language OS
Visual Studio Windows Phone C#, etc. Windows
Xcode Cocoa Touch Objective-C OSX
Eclipse Android Java All
Slide 55
Slide 55 text
Development platform
Platform IDE SDK Language OS
Visual Studio Windows Phone C#, etc. Windows
Visual Studio
Xamarin Studio
Cocoa Touch C#
(Compiled to ObjC)
Windows* /
OSX
Visual Studio
Xamarin Studio
Android C# Windows / OSX
* OSX build server required
Slide 56
Slide 56 text
Sharing Code
Application Layer
User Interface
Android SDK
Android SDK
Cocoa Touch
Cocoa Touch
Win Phone SDK
Win Phone SDK
Shared
- Model
- Data Access
- Business Logic
- Service Access