Reinvent Yourself Become an iOS Developer in Nine Steps 987654321987654321 987654321987654321.

53
Reinvent Yourself Become an iOS Developer in Nine Steps 987654321

Transcript of Reinvent Yourself Become an iOS Developer in Nine Steps 987654321987654321 987654321987654321.

Page 1: Reinvent Yourself Become an iOS Developer in Nine Steps 987654321987654321 987654321987654321.

Reinvent YourselfBecome an iOS Developer in Nine Steps

987654321987654321

Page 2: Reinvent Yourself Become an iOS Developer in Nine Steps 987654321987654321 987654321987654321.

Jason Hanson

✤ St. Louis, MO

✤ Alien Robot Overlords, Inc.

✤ Flash/Flex Dev (1999 - 2012)

✤ iOS Developer (2011-2013)

✤ @jayfour000

Page 3: Reinvent Yourself Become an iOS Developer in Nine Steps 987654321987654321 987654321987654321.

Change is Hard – Set a Goal

Page 4: Reinvent Yourself Become an iOS Developer in Nine Steps 987654321987654321 987654321987654321.

Change is Hard – The Plan

Page 5: Reinvent Yourself Become an iOS Developer in Nine Steps 987654321987654321 987654321987654321.

Change is Hard – Smaller Plan

Page 6: Reinvent Yourself Become an iOS Developer in Nine Steps 987654321987654321 987654321987654321.

Change is Hard – Woot! a Shovel

Page 7: Reinvent Yourself Become an iOS Developer in Nine Steps 987654321987654321 987654321987654321.

✤ Change is hard

✤ Fear >>= anger >>= hate >>= dark side

✤ Friction, heat, pressure, energy

✤ Takes time and patience

✤ Change too much at once and things break

✤ Don’t have to start over, start with what you have

✤ Change not is necessarily better or worse — just different

Properties of Change

Page 8: Reinvent Yourself Become an iOS Developer in Nine Steps 987654321987654321 987654321987654321.

Step 0: Start SomewhereWe all have to start where we are with what we have.

Page 9: Reinvent Yourself Become an iOS Developer in Nine Steps 987654321987654321 987654321987654321.

Step 1: Accept the Apple WayI <3 Apple (fake it till you make it)

Page 10: Reinvent Yourself Become an iOS Developer in Nine Steps 987654321987654321 987654321987654321.

✤ Apple knows better then you

✤ Well, they think they do anyway

✤ Like a child who insists that you disappear into the nether when you step out of sight

✤ Just nod, smile, and go along for the ride

✤ Some blind faith is required. Be comfortable with ‘not knowing’.

✤ Apple can do no wrong, even when wrong they bend the universe so that they are not wrong

Step 1 – Accept the Apple Way

Page 11: Reinvent Yourself Become an iOS Developer in Nine Steps 987654321987654321 987654321987654321.

Step 1 – Accept the Apple Way✤ Apple makes decisions for you ... so you don’t have to (good & bad)

✤ Form factor, asset types, sizes, names – lots of convention

✤ Supported OS versions (only need to support current + one version back!)

✤ App Store Rejections

✤ Available APIs (using undocumented APIs gets your app rejected)

✤ Appropriate content / interesting app

✤ Grades your code quality (rejects bad code)

Page 12: Reinvent Yourself Become an iOS Developer in Nine Steps 987654321987654321 987654321987654321.

Step 1 – Accept the Apple Way✤ Stuck in a Sandbox

✤ It is a really nice sandbox

✤ Be happy in your little corner and work with the tools provided

✤ Don’t waste time trying to go outside your sandbox

✤ ex: Closing app with code

✤ ex: Reading device phone number

✤ ex: Code injection

Page 13: Reinvent Yourself Become an iOS Developer in Nine Steps 987654321987654321 987654321987654321.

Second Thoughts?

✤ Hey! I want outta here! Maybe I can still make that session on Flex ...

✤ Wait ... why do I care about Flex still?

✤ javaScript unit tests?? (hmm ... lipstick? pig?)

✤ What other options do I have, really?

✤ But why would I subject myself to this egocentric platform?

✤ Should I really sell my last ounce of pride, and my soul, to Apple?

✤ Really f’ing Apple ... really, those guys?

Page 14: Reinvent Yourself Become an iOS Developer in Nine Steps 987654321987654321 987654321987654321.

Why I Chose iOS over JS & Android

Page 15: Reinvent Yourself Become an iOS Developer in Nine Steps 987654321987654321 987654321987654321.

Why I Chose iOS

✤ The ecosystem is very nice. Hard things are made easy.

✤ Solid Object Orientated language

✤ C and Obj-C useful for a very long time

✤ The ease and power of native device code was a breath of fresh air after fighting Flash to ‘act native’ for ten years

✤ Good developer community

✤ Good documentation

✤ Good tools Xcode Interface Builder, JetBrains AppCode

Page 16: Reinvent Yourself Become an iOS Developer in Nine Steps 987654321987654321 987654321987654321.

Why I Chose iOS

Page 17: Reinvent Yourself Become an iOS Developer in Nine Steps 987654321987654321 987654321987654321.

Why I Chose iOS

✤ The barrier to entry is higher then HTML/JS/CSS work

✤ The startup cost is high (@see Step 2)

✤ Hard(er) skill to learn IMO; lots more barriers

✤ Statistically less qualified developers

✤ Equates to better projects / higher bill rates

✤ The Apple App Store monazites better then competition

Page 18: Reinvent Yourself Become an iOS Developer in Nine Steps 987654321987654321 987654321987654321.

Why I Chose iOS

✤ iOS: • 90% on iOS 6• 2 screen aspect ratios• 3 screen DPIs

✤ Android:• 40% on “Jelly Bean”• 22% on “Ice Cream Sandwich” • 33% on “Gingerbread”• “Lots” of screens ...

Page 19: Reinvent Yourself Become an iOS Developer in Nine Steps 987654321987654321 987654321987654321.

Step 2 – Get the GearThe right tool for the job

Page 20: Reinvent Yourself Become an iOS Developer in Nine Steps 987654321987654321 987654321987654321.

Step 2 – Get the Gear

✤ Let's go shopping!

✤ Macintosh computer (MacBook Pro)

✤ iOS device (Retina iPad)

✤ Apple developer account

✤ Apple Xcode

✤ JetBrains AppCode

Page 21: Reinvent Yourself Become an iOS Developer in Nine Steps 987654321987654321 987654321987654321.

Step 3 – Hello WorldTime to play with the new toys!!

Page 22: Reinvent Yourself Become an iOS Developer in Nine Steps 987654321987654321 987654321987654321.

Step 3 – $1900 Hello World

✤ $1199.99 - Macintosh computer (MacBook Pro)

✤ $499.99 - iOS device (Retina iPad)

✤ $99.00 / year - Apple developer account

✤ $0.00 – Apple Xcode

✤ $199.00 – IntelliJ AppCode

✤ $29.99 - Cord to connect your iOS device (joking ... but just barely)

Page 23: Reinvent Yourself Become an iOS Developer in Nine Steps 987654321987654321 987654321987654321.

Step 3 – $1900 Hello World

✤ Yes, it just cost you $1900 to do a Hello World

✤ Deep breath, it is worth it. Stick with it.

✤ Good to know everything is working

✤ Show off to your friends

✤ Get setup to start playing!

Page 24: Reinvent Yourself Become an iOS Developer in Nine Steps 987654321987654321 987654321987654321.

Step 4 – Get OrganizedPrepare before setting off for your journey.

Page 25: Reinvent Yourself Become an iOS Developer in Nine Steps 987654321987654321 987654321987654321.

Step 4 – Get Organized

✤ Place to study (kitchen table, coffee shop, library)

✤ Schedule time to study (nights, weekends)

✤ Books

✤ Videos

✤ Forums

✤ Tools

Page 26: Reinvent Yourself Become an iOS Developer in Nine Steps 987654321987654321 987654321987654321.

Objective-C Programming

The Big Nerd Ranch

Aaron Hillegass

Forum where you can ask questions about code for each chapter in the book.

Page 27: Reinvent Yourself Become an iOS Developer in Nine Steps 987654321987654321 987654321987654321.

iOS Programing

The Big Nerd Ranch

Joe Conway & Aaron Hillegass

Forum where you can ask questions about code for each chapter in the book.

Page 28: Reinvent Yourself Become an iOS Developer in Nine Steps 987654321987654321 987654321987654321.

Cocoa Design Patterns

Erik M. Buck

Donald A. Yacktman

I have not read this book, but Joel Hooks recommended it to me.

Page 29: Reinvent Yourself Become an iOS Developer in Nine Steps 987654321987654321 987654321987654321.

WWDC VideosIncluded in your Apple Developer account

Page 30: Reinvent Yourself Become an iOS Developer in Nine Steps 987654321987654321 987654321987654321.

Stanford VideosFree videos. Apple SDK changes faster then the curriculum, but good starting point.

Page 31: Reinvent Yourself Become an iOS Developer in Nine Steps 987654321987654321 987654321987654321.

Stack OverflowUnlike Flash and Flex I found tons of very great posts with very usable code and answers most all of my questions.

Page 32: Reinvent Yourself Become an iOS Developer in Nine Steps 987654321987654321 987654321987654321.

Ray Wenderlichhttp://www.raywenderlich.com/

Great blog with amazing tutorials for everything you want to do

Page 33: Reinvent Yourself Become an iOS Developer in Nine Steps 987654321987654321 987654321987654321.

CodeRunner

OS X AppStore $9.99

Write and run code snips

Page 34: Reinvent Yourself Become an iOS Developer in Nine Steps 987654321987654321 987654321987654321.

Step 5 – Join the CommunityLearning is easier with friends!

Page 35: Reinvent Yourself Become an iOS Developer in Nine Steps 987654321987654321 987654321987654321.

Step 5 – Join the Community✤ Learning is easier with friends

✤ User groups – CocoaHeads (http://cocoaheads.org/)

✤ Message boards (Stack Overflow)

✤ Guy at coffee shop

✤ Friends, co-workers

✤ Give presentations

Page 36: Reinvent Yourself Become an iOS Developer in Nine Steps 987654321987654321 987654321987654321.

Intermission – Motivation(needed before next step)

✤ Find out what motivates you

Page 37: Reinvent Yourself Become an iOS Developer in Nine Steps 987654321987654321 987654321987654321.

Intermission – Motivation(needed before next step)

✤ My motivators

✤ Primal urge to provide food and shelter for my family

✤ Personal *fun* projects

✤ Competition with friends also reading the same books

✤ Little rewards

✤ Coffee at 4pm - doing my morning ritual at 8pm

Page 38: Reinvent Yourself Become an iOS Developer in Nine Steps 987654321987654321 987654321987654321.

Step 6 – Learn Core LanguageDeep down in the mine I mine at night.

Page 39: Reinvent Yourself Become an iOS Developer in Nine Steps 987654321987654321 987654321987654321.

Step 6 – Learn Core Language✤ This is hard. Very hard. No easy way around it,

only through it

✤ iOS apps are written in C and Objective-C

✤ C requires manual memory management

✤ Objective-C now has a memory management helper called ARC (Automatic Reference Counting)

✤ Any null pointer will crash your app - boom! I needed to get this right.

Page 40: Reinvent Yourself Become an iOS Developer in Nine Steps 987654321987654321 987654321987654321.

ActionScript 3 vs Objective-C

BOOL myBoolean = YES;int myInt = 13;float myFloat = 3.14;

NSObject *myObject = [[NSObject alloc] init];NSObject *myObject = @{};

NSArray *myArray = [[NSArray alloc] init];NSArray *myArray = @[];

- (int)addA:(int)a plusB:(int)b {return a + b;

}

var myBoolean:Boolean = true;var myInteger:int = 42;var myNumber:Number = 3.14;

var myObject:Object = new Object();var myObject:Object = {};

var myArray:Array = new Array();var myArray:Array = [];

public function addTwoInts(a:int, b:int):int {return a + b;

}

Page 41: Reinvent Yourself Become an iOS Developer in Nine Steps 987654321987654321 987654321987654321.

Storytelling Syntax

// Objective C-(void)showUserDataFor:(User *)user onDate:(NSDate *)date withSortOrder:(NSSortDescriptor)sortOrder{// TODO: method implementation }

Show user data for Jason on date Oct 28, 2013 with sort order ascending.

// Same method as above with colons lined up-(void)showUserDataFor:(User *)user onDate:(NSDate *)date withSortOrder:(NSSortDescriptor)sort{// TODO: method implementation }

// AS3public function showUserDataForUserOnDateWithSortOrder(user:User, date:Date, sortOrder:String):void {

// TODO: method implementation }

// AS3public function showUserData(user:User, date:Date, sortOrder:String):void {

// TODO: method implementation }

Page 42: Reinvent Yourself Become an iOS Developer in Nine Steps 987654321987654321 987654321987654321.

✤ Bringing old patterns that did not fit well; like meta-data dependency injection & presentation model

✤ Android patterns (widgets, expecting hardware back button)

✤ C and Objective-C numeric types

✤ CoreData

✤ Not learning more about Categories, Delegates, and the mediator design pattern early on.

Where I Stumbled

Page 43: Reinvent Yourself Become an iOS Developer in Nine Steps 987654321987654321 987654321987654321.

Gotcha – NumbersCodeRunner

#import <Foundation/Foundation.h>

int main(int argc, char *argv[]) {@autoreleasepool {

NSNumber *msTimeSince1970 = [NSNumber numberWithLongLong:1374759546000];int secTimeSince1970 = msTimeSince1970.intValue / 1000;

NSDate *myDate = [[NSDate alloc] initWithTimeIntervalSince1970:secTimeSince1970];

NSLog(@"The date is %@", myDate);

}}

Page 44: Reinvent Yourself Become an iOS Developer in Nine Steps 987654321987654321 987654321987654321.

Gotcha – StringsCodeRunner

#import <Foundation/Foundation.h>

int main(int argc, char *argv[]) {@autoreleasepool {

NSString *myString1 = @"foo";NSMutableString *myString2 = [NSMutableString stringWithString:@"foobar"];[myString2 replaceOccurrencesOfString:@"bar" withString:@"" options:NSLiteralSearch range:NSMakeRange(0, [myString2 length])];

NSLog(@"myString1 is: %@", myString1); // fooNSLog(@"myString2 is: %@", myString2); // foo NSLog(@"%d", (myString1 == myString2)); //0NSLog(@"%d", [myString1 isEqualToString:myString2]); //1

}

}

Page 45: Reinvent Yourself Become an iOS Developer in Nine Steps 987654321987654321 987654321987654321.

Step 7 – Study, study, OMG studyBook, book, book, book

Page 46: Reinvent Yourself Become an iOS Developer in Nine Steps 987654321987654321 987654321987654321.

Step 7 – Study, study, OMG study✤ Everyone learns in a different way

✤ Make slow, steady progress

✤ It will be hard

✤ Do lessons multiple times

✤ Review is an important part of learning

Page 47: Reinvent Yourself Become an iOS Developer in Nine Steps 987654321987654321 987654321987654321.

Step 8 – Build Free AppsOff to work I go

Page 48: Reinvent Yourself Become an iOS Developer in Nine Steps 987654321987654321 987654321987654321.

Step 8 – Build Free Apps

✤ Help out friends, people from the community (see step #5)

✤ Make apps that do something to help your life

✤ Release your own app to App Store

✤ Build relationships

Page 49: Reinvent Yourself Become an iOS Developer in Nine Steps 987654321987654321 987654321987654321.

Step 9 – Get PaidDiamonds!!!

Page 50: Reinvent Yourself Become an iOS Developer in Nine Steps 987654321987654321 987654321987654321.

Step 9 – Get Paid

✤ Charge for side work as soon as you can

✤ Replace your study time with billing time

✤ Balance learning with billing

✤ Build a good reputation

✤ Bill rates for iOS are comparable to Flash/Flex rates

Page 51: Reinvent Yourself Become an iOS Developer in Nine Steps 987654321987654321 987654321987654321.

My iOS Journey Timeline

✤ Sep 2011 - Started learning iOS

✤ Oct 2011 - Got iPad 1

✤ Nov 2011 - Flex is dead to me

✤ Feb 2012 - iOS dev account

✤ Mar 2012 - My first iPhone

✤ Apr 2012 - Billed first iOS work

✤ Apr 2012 - Speaker Cocoaheads

✤ Aug 2012 - iOS Speaker IDSTL

✤ Sep 2012 - Started full-time iOS

✤ Oct 2012 - Got iPad 3

✤ Jan 2013 - Hired iOS apprentice

✤ Aug 2013 - Speaker 360|Stack

Page 52: Reinvent Yourself Become an iOS Developer in Nine Steps 987654321987654321 987654321987654321.

Where I am today

✤ Still learning

✤ Contracting

✤ Mentoring apprentice

✤ Talking at user groups

✤ Keeping on eye on what is coming up next (wearable computing)

Page 53: Reinvent Yourself Become an iOS Developer in Nine Steps 987654321987654321 987654321987654321.