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

Post on 26-Dec-2015

222 views 1 download

Tags:

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

Reinvent YourselfBecome an iOS Developer in Nine Steps

987654321987654321

Jason Hanson

✤ St. Louis, MO

✤ Alien Robot Overlords, Inc.

✤ Flash/Flex Dev (1999 - 2012)

✤ iOS Developer (2011-2013)

✤ @jayfour000

Change is Hard – Set a Goal

Change is Hard – The Plan

Change is Hard – Smaller Plan

Change is Hard – Woot! a Shovel

✤ 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

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

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

✤ 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

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)

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

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?

Why I Chose iOS over JS & Android

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

Why I Chose iOS

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

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 ...

Step 2 – Get the GearThe right tool for the job

Step 2 – Get the Gear

✤ Let's go shopping!

✤ Macintosh computer (MacBook Pro)

✤ iOS device (Retina iPad)

✤ Apple developer account

✤ Apple Xcode

✤ JetBrains AppCode

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

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)

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!

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

Step 4 – Get Organized

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

✤ Schedule time to study (nights, weekends)

✤ Books

✤ Videos

✤ Forums

✤ Tools

Objective-C Programming

The Big Nerd Ranch

Aaron Hillegass

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

iOS Programing

The Big Nerd Ranch

Joe Conway & Aaron Hillegass

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

Cocoa Design Patterns

Erik M. Buck

Donald A. Yacktman

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

WWDC VideosIncluded in your Apple Developer account

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

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

Ray Wenderlichhttp://www.raywenderlich.com/

Great blog with amazing tutorials for everything you want to do

CodeRunner

OS X AppStore $9.99

Write and run code snips

Step 5 – Join the CommunityLearning is easier with friends!

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

Intermission – Motivation(needed before next step)

✤ Find out what motivates you

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

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

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.

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;

}

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 }

✤ 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

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);

}}

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

}

}

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

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

Step 8 – Build Free AppsOff to work I go

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

Step 9 – Get PaidDiamonds!!!

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

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

Where I am today

✤ Still learning

✤ Contracting

✤ Mentoring apprentice

✤ Talking at user groups

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