first steps in ios development

17
© Copyright SELA software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com Sasha Goldshtein @goldshtn CTO, SELA Group blog.sashag.net First Steps in iOS Development

Upload: sasha-goldshtein

Post on 09-May-2015

949 views

Category:

Technology


0 download

DESCRIPTION

Presentation at ConFoo 2014 on iOS Development. Discussing the basic components of the iOS ecosystem and building a basic todo list manager app with Xcode and storyboards.

TRANSCRIPT

Page 1: First Steps in iOS Development

© Copyright SELA software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com

Sasha Goldshtein @goldshtnCTO, SELA Group blog.sashag.netFirst Steps in iOS Development

Page 2: First Steps in iOS Development

The iOS Platform

• 877,013+ of them Apps• UI, gestures, view

navigation, mediaCocoa Touch

• Location, threading, HTTP

Core Services

• Drivers, securityDarwin (kernel)

Page 3: First Steps in iOS Development

Platform Philosophy

User

• Consistent interface metaphors

• Always at home, on any device and in any app

• Seamless sync, backup, purchase

Developer

• Strong push to object orientation

• Just one language (Objective C)

• Strong separation of concerns in UI – MVC

Apple

• Full control over the ecosystem, hardware and software

• Ultimate arbitrator on whether an app is a fit for the App Store

Page 4: First Steps in iOS Development

iOS Devices and Versions

iPhone 3GS• iOS 3• iOS 4

Original iPad

iPhone 4/4S• iOS 5

iPhone 5• iOS 6

iPhone 5c/5s• iOS 7

September 2013:≈95% of iOS

devices run iOS 6

Page 5: First Steps in iOS Development

Devices and Resolutions

iPhone

3/3GS

3.5”

320×480

iPhone

4/4S

3.5”

640×960

iPhone

5/5c/5s

4”

640×1136

iPad 1/2

9.7”

1024×768

iPad Mini

7.9”

1024×768

iPad 3/4

9.7”

2048×1536

Page 6: First Steps in iOS Development

Developing for iOS

Xcode

Objective C

UIKit

self.title = [NSString initWithFormat:@"%d", n];[button setTitle:self.title forState:UIControlStateNormal];

Page 7: First Steps in iOS Development

Demo

Our First iOS App

Page 8: First Steps in iOS Development

Project Components

Generated files:Application delegateInitial view controllerMain storyboardProperty listFile for localizable stringsApplication icons

Xcode also adds basic frameworks to your app

Page 9: First Steps in iOS Development

iOS MVC Fundamentals

View

• Draws itself on the screen

• Contains generic UI-related data

View Controller

• Creates and coordinates views

• Populates views and reflects changes to the model

Model

• UI-agnostic classes

• Can be a bunch of objects, a database, a file, an Internet service

Page 10: First Steps in iOS Development

Outlets and Actions

Xcode connects views and controllersController manipulates views through outletsController receives events through actions

@interface MyViewController : UIViewController

@property (nonatomic, weak) IBOutlet UITextField *petName;

- (IBAction)getQuote;

@end

Page 11: First Steps in iOS Development

Demo

Connecting UI to Code

Page 12: First Steps in iOS Development

iOS Navigation Types

Tab bar controllerNavigation controller

Page 13: First Steps in iOS Development

Storyboards

The storyboard describes your application’s view controllers and connects them with segues

Page 14: First Steps in iOS Development

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}

Page 15: First Steps in iOS Development

Demo

Storyboards and Segues

Page 16: First Steps in iOS Development

Summary

Objective C fundamentalsView controllers, views, outlets, actionsStoryboards, seguesIt’s just another{language, IDE, UI framework}The rest is just details: data, networking, settings, table views, styling, …

Page 17: First Steps in iOS Development

QuestionsSasha Goldshtein @goldshtnCTO, SELA Group blog.sashag.net