first steps in ios development
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](https://reader033.vdocument.in/reader033/viewer/2022060108/554d1d3fb4c905c5208b4809/html5/thumbnails/1.jpg)
© 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](https://reader033.vdocument.in/reader033/viewer/2022060108/554d1d3fb4c905c5208b4809/html5/thumbnails/2.jpg)
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](https://reader033.vdocument.in/reader033/viewer/2022060108/554d1d3fb4c905c5208b4809/html5/thumbnails/3.jpg)
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](https://reader033.vdocument.in/reader033/viewer/2022060108/554d1d3fb4c905c5208b4809/html5/thumbnails/4.jpg)
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](https://reader033.vdocument.in/reader033/viewer/2022060108/554d1d3fb4c905c5208b4809/html5/thumbnails/5.jpg)
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](https://reader033.vdocument.in/reader033/viewer/2022060108/554d1d3fb4c905c5208b4809/html5/thumbnails/6.jpg)
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](https://reader033.vdocument.in/reader033/viewer/2022060108/554d1d3fb4c905c5208b4809/html5/thumbnails/7.jpg)
Demo
Our First iOS App
![Page 8: First Steps in iOS Development](https://reader033.vdocument.in/reader033/viewer/2022060108/554d1d3fb4c905c5208b4809/html5/thumbnails/8.jpg)
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](https://reader033.vdocument.in/reader033/viewer/2022060108/554d1d3fb4c905c5208b4809/html5/thumbnails/9.jpg)
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](https://reader033.vdocument.in/reader033/viewer/2022060108/554d1d3fb4c905c5208b4809/html5/thumbnails/10.jpg)
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](https://reader033.vdocument.in/reader033/viewer/2022060108/554d1d3fb4c905c5208b4809/html5/thumbnails/11.jpg)
Demo
Connecting UI to Code
![Page 12: First Steps in iOS Development](https://reader033.vdocument.in/reader033/viewer/2022060108/554d1d3fb4c905c5208b4809/html5/thumbnails/12.jpg)
iOS Navigation Types
Tab bar controllerNavigation controller
![Page 13: First Steps in iOS Development](https://reader033.vdocument.in/reader033/viewer/2022060108/554d1d3fb4c905c5208b4809/html5/thumbnails/13.jpg)
Storyboards
The storyboard describes your application’s view controllers and connects them with segues
![Page 14: First Steps in iOS Development](https://reader033.vdocument.in/reader033/viewer/2022060108/554d1d3fb4c905c5208b4809/html5/thumbnails/14.jpg)
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](https://reader033.vdocument.in/reader033/viewer/2022060108/554d1d3fb4c905c5208b4809/html5/thumbnails/15.jpg)
Demo
Storyboards and Segues
![Page 16: First Steps in iOS Development](https://reader033.vdocument.in/reader033/viewer/2022060108/554d1d3fb4c905c5208b4809/html5/thumbnails/16.jpg)
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](https://reader033.vdocument.in/reader033/viewer/2022060108/554d1d3fb4c905c5208b4809/html5/thumbnails/17.jpg)
QuestionsSasha Goldshtein @goldshtnCTO, SELA Group blog.sashag.net