First Steps in iOS Development
Upcoming SlideShare
Loading in...5
×
 

First Steps in iOS Development

on

  • 3,572 views

Have you always been interested in iOS development but never took the plunge and installed the dev tools? In this presentation we look at the basic steps of iOS application development, and then move ...

Have you always been interested in iOS development but never took the plunge and installed the dev tools? In this presentation we look at the basic steps of iOS application development, and then move on to slightly more advanced features like storyboards and segues (introduced with iOS 5).

Statistics

Views

Total Views
3,572
Views on SlideShare
959
Embed Views
2,613

Actions

Likes
4
Downloads
20
Comments
0

26 Embeds 2,613

http://blogs.microsoft.co.il 1334
http://www.scoop.it 767
http://cloud.feedly.com 192
http://feeds.feedburner.com 149
http://www.newsblur.com 40
http://feedreader.com 27
http://lanyrd.com 20
http://www.feedspot.com 14
http://newsblur.com 13
http://alvinashcraft.newsblur.com 10
http://inoreader.com 9
http://reader.aol.com 6
http://www.inoreader.com 5
http://digg.com 5
http://gladyspintado.tumblr.com 4
http://smashingreader.com 4
http://feedly.com 3
http://webcache.googleusercontent.com 2
http://tiriss.com 2
http://www.hanrss.com 1
http://summary 1
http://fezreader.com 1
http://subscribe.ru 1
http://java.dzone.com 1
http://www.dzone.com 1
http://swazzy.com 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

First Steps in iOS Development First Steps in iOS Development Presentation Transcript

  • First Steps in iOS Development Sasha Goldshtein CTO, Sela Group @goldshtn blog.sashag.net
  • Join the conversation on Twitter: @SoftArchConf #SoftArchConf The iOS Platform
  • Join the conversation on Twitter: @SoftArchConf #SoftArchConf Platform Philosophy
  • Join the conversation on Twitter: @SoftArchConf #SoftArchConf iOS Devices and Versions September 2013: ≈95% of iOS devices run iOS 6
  • Join the conversation on Twitter: @SoftArchConf #SoftArchConf Devices and Resolutions Don’t worry about Retina: all you need to do is provide 2x images for your graphical assets Don’t worry about iPhone 5: most views will resize correctly with AutoLayout or require minimal tweaks
  • Join the conversation on Twitter: @SoftArchConf #SoftArchConf Developing for iOS self.title = [NSString initWithFormat:@"%d", n]; [button setTitle:self.title forState:UIControlStateNormal];
  • Join the conversation on Twitter: @SoftArchConf #SoftArchConf Objective C Classes • Declare in .h file, implement in .m file – @interface and @implementation keywords
  • Join the conversation on Twitter: @SoftArchConf #SoftArchConf Methods @interface Cat : NSObject - (void)meow; - (BOOL)doesLikeOtherCat:(Cat *)other; - (int)age; @end @implementation Cat - (void)meow { NSLog(@"Meow"); } - (int)age { return 7; } - (BOOL)doesLikeOtherCat:(Cat *)other { if ([self age] <= [other age]) return YES; return NO; } @end Q: What about nil checks?! A: Messages sent to nil return 0/nil/NO
  • Join the conversation on Twitter: @SoftArchConf #SoftArchConf Initializers @interface Cat : Mammal { int age_; // This is a public instance field } - (id)initWithAge:(int)age; @end @implementation Cat - (id)initWithAge:(int)age { self = [super init]; if (self) age_ = age; return self; } @end
  • Join the conversation on Twitter: @SoftArchConf #SoftArchConf Properties @interface Cat : NSObject @property (nonatomic) int age; - (id)initWithAge:(int)age; @end @implementation Cat - (id)initWithAge:(int)age { if (self = [super init]) _age = age; // Auto-generated field! return self; } @end
  • Join the conversation on Twitter: @SoftArchConf #SoftArchConf Using Objects Cat *felix = [[Cat alloc] initWithAge:5]; Cat *shadow = [[Cat alloc] initWithAge:4]; if ([felix likesOtherCat:shadow]) { // Left to your imagination } NSDate *today = [NSDate date]; // Current date if ([Calendar isBirthday:shadow onDate:today]) { shadow.age++; [shadow meow]; }
  • Join the conversation on Twitter: @SoftArchConf #SoftArchConf Memory Management: ARC • Heap objects are reference counted – Support release, retain, retainCount messages • Automatic Reference Counting (ARC) takes care of memory management – The compiler embeds the appropriate reference counting messages automatically – Introduced in iOS 4 with LLVM compiler – With one caveat: reference cycles
  • Join the conversation on Twitter: @SoftArchConf #SoftArchConf Basic Foundation Classes • Strings – Immutable/mutable, @"foo" syntax • Arrays – May contain any object type (NSObject) – Immutable/mutable, @[a, b, c] syntax • Dictionaries – Keys are usually strings, but don’t have to be – Immutable/mutable, @{ a : b } syntax
  • Join the conversation on Twitter: @SoftArchConf #SoftArchConf DEMO Our first iOS app
  • Join the conversation on Twitter: @SoftArchConf #SoftArchConf Project Components • Generated files: – Application delegate – Initial view controller – Main storyboard – Property list – File for localizable strings – Application icons • Xcode also adds basic frameworks to your app
  • Join the conversation on Twitter: @SoftArchConf #SoftArchConf iOS MVC Fundamentals
  • Join the conversation on Twitter: @SoftArchConf #SoftArchConf Outlets and Actions • Xcode connects views and controllers – Controller manipulates views through outlets – Controller receives events through actions @interface MyViewController : UIViewController @property (nonatomic, weak) IBOutlet UITextField *petName; - (IBAction)getQuote; @end
  • Join the conversation on Twitter: @SoftArchConf #SoftArchConf DEMO Connecting UI to code
  • Join the conversation on Twitter: @SoftArchConf #SoftArchConf iOS Navigation Types • Tab bar controller • Navigation controller
  • Join the conversation on Twitter: @SoftArchConf #SoftArchConf Storyboards • The storyboard describes your application’s view controllers and connects them with segues
  • Join the conversation on Twitter: @SoftArchConf #SoftArchConf Types of Segues
  • Join the conversation on Twitter: @SoftArchConf #SoftArchConf Passing Parameters • Usually the source view controller sets properties or calls methods on the destination view controller - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { MySecondVC *vc = segue.destinationViewController; vc.itemToDisplay = [self selectedItem]; vc.delegate = self; // For callbacks }
  • Join the conversation on Twitter: @SoftArchConf #SoftArchConf DEMO Storyboards and segues
  • Join the conversation on Twitter: @SoftArchConf #SoftArchConf Summary • It’s just another {language, IDE, UI framework} • The rest is just details: data, networking, settings, table views, styling, …
  • Thank You! Sasha Goldshtein CTO, Sela Group @goldshtn blog.sashag.net