Designing iphone Applications

Size: px
Start display at page:

Download "Designing iphone Applications"

Transcription

1 Designing iphone Applications 4

2 Two Flavors of Mail 5

3 Organizing Content 6

4 Organizing Content 6

5 Organizing Content 6

6 Organizing Content 6

7 Organizing Content Focus on your user s data 6

8 Organizing Content Focus on your user s data One thing at a time 6

9 Organizing Content Focus on your user s data One thing at a time Screenfuls of content 6

10 Patterns for Organizing Content 7

11 Patterns for Organizing Content Navigation Bar 7

12 Patterns for Organizing Content Navigation Bar Tab Bar 7

13 Navigation Bar Hierarchy of content Drill down into greater detail 8

14 Navigation Bar Hierarchy of content Drill down into greater detail 8

15 Tab Bar Self-contained modes 9

16 Tab Bar Self-contained modes 9

17 A Screenful of Content Slice of your application Views, data, logic 10

18 Parts of a Screenful Model View 11

19 Parts of a Screenful Model View Controller 11

20 Parts of a Screenful Model View Controller 12

21 Model-View-Controller (Why and How?) 13

22 Why Model-View-Controller? Ever used the word spaghetti to describe code? Clear responsibilities make things easier to maintain Avoid having one monster class that does everything 14

23 Why Model-View-Controller? Ever used the word spaghetti to describe code? Clear responsibilities make things easier to maintain Avoid having one monster class that does everything 14

24 Why Model-View-Controller? Separating responsibilites also leads to reusability By minimizing dependencies, you can take a model or view class you ve already written and use it elsewhere Think of ways to write less code 15

25 Communication and MVC How should objects communicate? Which objects know about one another? 16

26 Communication and MVC How should objects communicate? Which objects know about one another? Model Example: Polygon class Not aware of views or controllers Typically the most reusable Communicate generically using... Key-value observing Model Notifications 17

27 Communication and MVC How should objects communicate? Which objects know about one another? View Example: PolygonView class Not aware of controllers, may be aware of relevant model objects Also tends to be reusable Communicate with controller using... Target-action View Delegation 18

28 Communication and MVC How should objects communicate? Which objects know about one another? Controller Knows about model and view objects The brains of the operation Manages relationships and data flow Typically app-specific, so rarely reusable Controller 19

29 Communication and MVC Model View Controller 20

30 Communication and MVC Model View Controller 20

31 Communication and MVC Model View KVO, notifications target-action, delegation Controller 20

32 View Controllers CPRE 388

33 View Controllers Manage views in model view controller design template. Many types: custom view controller; container view controller; modal view controller.

34

35 Custom View controllers At least one per app. Subclass of UIViewController UIViewController instances have data (member vars), view through member vars pointing to IBOutlets, action methods, and any other view control related activities.

36

37 Table View Controllers Table of data Selection management Row editing Table configuration Table view object managed by UITableViewController

38

39 Navigation View Controller Container view controller to manage data/views organized hierarchically. Instance of class UINavigationController Manages multiple view controllers but also some views a navigation bar current location in data hierarchy; back button; custom controls for the current view

40

41 Tab Bar Controller Container controller UITabBarController class Present same data differently or present different types of data If there are more views than the space for tabs on the tab bar, Tab bar controller also manages tab bar

42

43 Modal View Controllers Just a mode of presenting a VC from another VC Generalization of container VCs. Typical present a view to gather some user information picking a picture for a calendar contact

44

45 Anatomy: Custom View Controller

46 Custom VC essential tasks You must configure the view to be loaded by your view controller You must decide which orientations your view controller supports You must clean up the memory that is managed by your view controller

47 Typical VC Members Member variables pointing to the objects containing the data to be displayed by the corresponding views Member variables (or outlets) pointing to key view objects with which your view controller must interact Action methods that perform tasks associated with buttons and other controls in the view hierarchy Custom tasks

48 View Management Cycles Load cycle Unload cycle

49 Load Cycle Some part of your application asks for the view in the view controller s view property If the view is not currently in memory, the view controller calls its loadview method The loadview method responsible for loading a non nil view

50 loadview If over ridden, you are responsible for creating all views, and assigning a non nil view property. Default implementation uses nibname and nibbundle. If no nib file found, creates empty UIView object and assigns it to view property.

51

52

53 Creating a VC (void)displaymodalview { MyViewController* vc = [[[MyViewController alloc] initwithnibname:@"myviewcontroller" bundle:nil] autorelease]; [self presentmodalviewcontroller:vc animated:yes]; }

54 Class MyViewController : UIViewController { id mybutton; id mytextfield; (nonatomic) IBOutlet id (nonatomic) IBOutlet id mytextfield; (IBAction)myAction:(id)sender;

55 Contents of MyViewConroller.nib

56 (void)loadview { self.wantsfullscreenlayout = YES; MetronomeView *view = [[MetronomeView alloc] initwithframe:[uiscreen mainscreen].applicationframe]; view.metronomeviewcontroller = self; self.view = view; self. [view release]; }

57 When overriding the loadview method to create your views programmatically, you should not call super. Doing so initiates the default view loading behavior and is usually just a waste of CPU cycles. Your own implementation of the loadview method should do all the work that is needed to create a root view and subviews for your view controller.

58 Cleaning up after Unloading Clean up references to view objects in: The dealloc method The viewdidunload method

59 View Orientations At minimum, portrait orientation needs to be supported by default. Additional orientations can be supported by a view controller (optionally). Both views and view controllers have to do additional work.

60 Orientations Override your view controller s shouldautorotatetointerfaceorientation: method Configure the autoresizing mask for each view in your view controller s view hierarchy

61 Orientation When the device orientation changes, systems sends out UIDeviceOrientationDidChangeNotification notification UIKit framework intercepts this notification and uses it to update your interface orientation automatically The window object does much of the work associated with changing the current orientation

62 Orientation Polls view controllers at the front to see if they support the alternate orientation. These view controllers should ask their subviews (controllers) about their support for the new (proposed) orientation.

63 Declaring the Supported Interface Orientations (BOOL)shouldAutorotateToInterfaceOrientation:( UIInterfaceOrientation)orientation { if ((orientation == UIInterfaceOrientationPortrait) (orientation == UIInterfaceOrientationLandscapeLeft)) return YES; return NO; }

64 View Resizing on Re Orientation the bounds of the affected views are modified automatically according to their autoresizing mask. you might use these notifications to make the following types of changes: Show or hide views that are specific to a particular orientation Show or hide views that are specific to a particular orientation Show or hide views that are specific to a particular orientation

65

66 Memory Management critical data structures required by your view controller; Initialization methods; Creating view objects; loadview Allocating or loading data to be displayed in your view; viewdidload

67 Releasing refs to view objects; viewdidunload; Releasing the data not needed when view is not displayed; viewdidunload; Responding to low memory notifications; didreceivememorywarning Releasing critical data structures required by your view controller; dealloc

68 View Controllers 21

69 Problem: Managing a Screenful Controller manages views, data and application logic Apps are made up of many of these Would be nice to have a well-defined starting point A la UIView for views Common language for talking about controllers 22

70 Problem: Building Typical Apps Some application flows are very common Navigation-based Tab bar-based Combine the two Don t reinvent the wheel Plug individual screens together to build an app 23

71 UIViewController Basic building block Manages a screenful of content Subclass to add your application logic View Controller Views Data Logic 24

72 UIViewController Basic building block Manages a screenful of content Subclass to add your application logic 24

73 Your and Our View Controllers Create your own UIViewController subclass for each screenful Plug them together using existing composite view controllers 25

74 Your and Our View Controllers Create your own UIViewController subclass for each screenful Plug them together using existing composite view controllers Navigation Controller View Controller View Controller View Controller 25

75 Your and Our View Controllers Create your own UIViewController subclass for each screenful Plug them together using existing composite view controllers View Controller Tab Bar Controller View Controller View Controller 25

76 Your View Controller Subclass 26

77 Your View Controller Subclass #import MyViewController : UIViewController { // A view controller will usually // manage views and data NSMutableArray *mydata; UILabel *mylabel; } 26

78 Your View Controller Subclass #import MyViewController : UIViewController { // A view controller will usually // manage views and data NSMutableArray *mydata; UILabel *mylabel; } // Expose some of its contents to (readonly) NSArray *mydata; 26

79 Your View Controller Subclass #import MyViewController : UIViewController { // A view controller will usually // manage views and data NSMutableArray *mydata; UILabel *mylabel; } // Expose some of its contents to (readonly) NSArray *mydata; // And respond to actions - (void)dosomeaction:(id)sender; 26

80 The View in View Controller 27

81 The View in View Controller UIViewController superclass has a view (retain) UIView *view; 27

82 The View in View Controller UIViewController superclass has a view (retain) UIView *view; Loads lazily On demand when requested Can be purged on demand as well (low memory) 27

83 The View in View Controller UIViewController superclass has a view (retain) UIView *view; Loads lazily On demand when requested Can be purged on demand as well (low memory) Sizing and positioning the view? Depends on where it s being used Don t make assumptions, be flexible 27

84 When to call -loadview? 28

85 When to call -loadview? Don t do it! 28

86 When to call -loadview? Don t do it! Cocoa tends to embrace a lazy philosophy Call -release instead of -dealloc Call -setneedsdisplay instead of -drawrect: 28

87 When to call -loadview? Don t do it! Cocoa tends to embrace a lazy philosophy Call -release instead of -dealloc Call -setneedsdisplay instead of -drawrect: Allows work to be deferred or coalesced Performance! 28

88 Creating Your View in Code 29

89 Creating Your View in Code Override -loadview Never call this directly // Subclass of UIViewController - (void)loadview { } 29

90 Creating Your View in Code Override -loadview Never call this directly Create your views // Subclass of UIViewController - (void)loadview { MyView *myview = [[MyView alloc] initwithframe:frame]; } [myview release]; 29

91 Creating Your View in Code Override -loadview Never call this directly Create your views Set the view property // Subclass of UIViewController - (void)loadview { MyView *myview = [[MyView alloc] initwithframe:frame]; self.view = myview; // The view controller now owns the view [myview release]; } 29

92 Creating Your View in Code Override -loadview Never call this directly Create your views Set the view property Create view controller with -init // Subclass of UIViewController - (void)loadview { MyView *myview = [[MyView alloc] initwithframe:frame]; self.view = myview; // The view controller now owns the view [myview release]; } 29

93 Creating Your View with Interface Builder 30

94 Creating Your View with Interface Builder Lay out a view in Interface Builder 30

95 Creating Your View with Interface Builder Lay out a view in Interface Builder File s owner is view controller class 30

96 Creating Your View with Interface Builder Lay out a view in Interface Builder File s owner is view controller class Hook up view outlet 30

97 Creating Your View with Interface Builder Lay out a view in Interface Builder File s owner is view controller class Hook up view outlet Create view controller with -initwithnibname:bundle: 30

98 View Controller Lifecycle 32

99 View Controller Lifecycle - (id)initwithnibname:(nsstring *)nibname bundle:(nsbundle *)bundle { if (self == [super init...]) { // Perform initial setup, nothing view-related mydata = [[NSMutableArray alloc] init]; self.title Foo ; } return self; } 32

100 View Controller Lifecycle 33

101 View Controller Lifecycle - (void)viewdidload { // Your view has been loaded // Customize it here if needed view.someweirdproperty = YES; } 33

102 View Controller Lifecycle 34

103 View Controller Lifecycle - (void)viewwillappear:(bool)animated { [super viewwillappear:animated]; } // Your view is about to show on the screen [self beginloadingdatafromtheweb]; [self startshowingloadingprogress]; 34

104 View Controller Lifecycle 35

105 View Controller Lifecycle - (void)viewwilldisappear:(bool)animated { [super viewwilldisappear:animated]; } // Your view is about to leave the screen [self rememberscrollposition]; [self savedatatodisk]; 35

106 Loading & Saving Data Lots of options out there, depends on what you need NSUserDefaults Property lists CoreData SQLite Web services Covering in greater depth in Lecture 9 on 4/29 36

107 More View Controller Hooks Automatically rotating your user interface Low memory warnings 38

108 Supporting Interface Rotation 39

109 Supporting Interface Rotation - (BOOL)shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation { // This view controller only supports portrait return (interfaceorientation == UIInterfaceOrientationPortrait); } 39

110 Supporting Interface Rotation 40

111 Supporting Interface Rotation - (BOOL)shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation { // This view controller supports all orientations // except for upside-down. return (interfaceorientation!= UIInterfaceOrientationPortraitUpsideDown); } 40

112 Autoresizing Your Views 42

113 Autoresizing Your Views view.autoresizingmask = UIViewAutoresizingFlexibleWidth UIViewAutoresizingFlexibleHeight; 42

114 Autoresizing Your Views view.autoresizingmask = UIViewAutoresizingFlexibleWidth UIViewAutoresizingFlexibleHeight; 42

115 Autoresizing Your Views view.autoresizingmask = UIViewAutoresizingFlexibleWidth UIViewAutoresizingFlexibleHeight; view.autoresizingmask = UIViewAutoresizingFlexibleWidth UIViewAutoresizingFlexibleTopMargin; 42

116 Autoresizing Your Views view.autoresizingmask = UIViewAutoresizingFlexibleWidth UIViewAutoresizingFlexibleHeight; view.autoresizingmask = UIViewAutoresizingFlexibleWidth UIViewAutoresizingFlexibleTopMargin; 42

View Controllers CPRE 388

View Controllers CPRE 388 View Controllers CPRE 388 View Controllers Manage views in model view controller design template. Many types: custom view controller; container view controller; modal view controller. Custom View controllers

More information

Why Model-View-Controller?

Why Model-View-Controller? View Controllers Why Model-View-Controller? Ever used the word spaghetti to describe code? Clear responsibilities make things easier to maintain Avoid having one monster class that does everything Why

More information

Announcements. Today s Topics

Announcements. Today s Topics Announcements Lab 2 is due tonight Lab 3 is posted Due next Wednesday Sept 30 th 1 Extensible - CSE 436 Software Networking Engineering Platform Workshop 1 Today s Topics Designing iphone Applica;ons Model-

More information

Announcements. Today s Topics

Announcements. Today s Topics Announcements Lab 2 is due tonight by 11:59 PM Late policy is 10% of lab total per day late So -7.5 points per day late for lab 2 Labs 3 and 4 are posted on the course website Extensible Networking Platform

More information

User Experience: Windows & Views

User Experience: Windows & Views View Controller Programming Guide for ios User Experience: Windows & Views 2011-01-07 Apple Inc. 2011 Apple Inc. All rights reserved. No part of this publication may be reproduced, stored in a retrieval

More information

View Controller Lifecycle

View Controller Lifecycle View Controller Lifecycle View Controllers have a Lifecycle A sequence of messages is sent to them as they progress through it Why does this matter? You very commonly override these methods to do certain

More information

ios Mobile Development

ios Mobile Development ios Mobile Development Today UITextView Scrollable, editable/selectable view of a mutable attributed string. View Controller Lifecycle Finding out what s happening as a VC is created, hooked up to the

More information

Developing Applications for ios

Developing Applications for ios Developing Applications for ios Lecture 7: View Controller Lifecycle and UIKit Radu Ionescu raducu.ionescu@gmail.com Faculty of Mathematics and Computer Science University of Bucharest Content View Controller

More information

Navigation bar (Xcode version 4.5.2) 1. Create a new project. From the Xcode menu, select File > New > Project

Navigation bar (Xcode version 4.5.2) 1. Create a new project. From the Xcode menu, select File > New > Project Navigation bar (Xcode version 4.5.2) 1. Create a new project. From the Xcode menu, select File > New > Project Choose the Single View Application template Click Next. In the Choose options for your new

More information

Building GUIs with UIKit. Kevin Cathey

Building GUIs with UIKit. Kevin Cathey Building GUIs with UIKit Kevin Cathey Building GUIs with UIKit acm.uiuc.edu/macwarriors/devphone Building GUIs with UIKit What is UIKit? acm.uiuc.edu/macwarriors/devphone Building GUIs with UIKit What

More information

iphone Application Tutorial

iphone Application Tutorial iphone Application Tutorial 2008-06-09 Apple Inc. 2008 Apple Inc. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any

More information

Naviga&on and Tab Bar Controllers and Table View

Naviga&on and Tab Bar Controllers and Table View Naviga&on and Tab Bar Controllers and Table View UINaviga)onController Stack of view controllers Naviga)on bar How It Fits Together Top view controller s view Top view controller s )tle Previous view controller

More information

OVERVIEW. Why learn ios programming? Share first-hand experience. Identify platform differences. Identify similarities with.net

OVERVIEW. Why learn ios programming? Share first-hand experience. Identify platform differences. Identify similarities with.net OVERVIEW Why learn ios programming? Share first-hand experience. Identify platform differences. Identify similarities with.net Microsoft MVP for 4 years C#, WinForms, WPF, Silverlight Joined Cynergy about

More information

User Experience: Windows & Views

User Experience: Windows & Views View Programming Guide for ios User Experience: Windows & Views 2010-07-07 Apple Inc. 2010 Apple Inc. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or

More information

My First iphone App (for Xcode version 6.4)

My First iphone App (for Xcode version 6.4) My First iphone App (for Xcode version 6.4) 1. Tutorial Overview In this tutorial, you re going to create a very simple application on the iphone or ipod Touch. It has a text field, a label, and a button

More information

iphone App Basics iphone and ipod touch Development Fall 2009 Lecture 5

iphone App Basics iphone and ipod touch Development Fall 2009 Lecture 5 iphone App Basics iphone and ipod touch Development Fall 2009 Lecture 5 Questions? Announcements Assignment #1 due this evening by 11:59pm Remember, if you wish to use a free late you must email me before

More information

Your First iphone OS Application

Your First iphone OS Application Your First iphone OS Application General 2010-03-15 Apple Inc. 2010 Apple Inc. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form

More information

Your First iphone Application

Your First iphone Application Your First iphone Application General 2009-01-06 Apple Inc. 2009 Apple Inc. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form

More information

Assignment III: Graphing Calculator

Assignment III: Graphing Calculator Assignment III: Graphing Calculator Objective The goal of this assignment is to reuse your CalculatorBrain and CalculatorViewController objects to build a Graphing Calculator. By doing this, you will gain

More information

Apple Development Technology Workshops

Apple Development Technology Workshops Apple Development Technology Workshops Workshop 10 Table Views Building iphone Apps. Pt 2 Fall 2008 Hafez Rouzati Fall 2008 Zach Pousman Last Week UIViewControllers Organizing Content & Building iphone

More information

The MVC Design Pattern

The MVC Design Pattern The MVC Design Pattern The structure of iphone applications is based on the Model-View-Controller (MVC) design pattern because it benefits object-oriented programs in several ways. MVC based programs tend

More information

SAMPLE CHAPTER. Brendan G. Lim Martin Conte Mac Donell MANNING

SAMPLE CHAPTER. Brendan G. Lim Martin Conte Mac Donell MANNING SAMPLE CHAPTER Brendan G. Lim Martin Conte Mac Donell MANNING ios 7 in Action by Brendan G. Lim Martin Conte Mac Donell Chapter 2 Copyright 2014 Manning Publications brief contents PART 1 BASICS AND NECESSITIES...1

More information

My First iphone App. 1. Tutorial Overview

My First iphone App. 1. Tutorial Overview My First iphone App 1. Tutorial Overview In this tutorial, you re going to create a very simple application on the iphone or ipod Touch. It has a text field, a label, and a button. You can type your name

More information

Structuring an App Copyright 2013 Apple Inc. All Rights Reserved.

Structuring an App Copyright 2013 Apple Inc. All Rights Reserved. Structuring an App App Development Process (page 30) Designing a User Interface (page 36) Defining the Interaction (page 42) Tutorial: Storyboards (page 47) 29 App Development Process Although the task

More information

iphone Programming Patrick H. Madden SUNY Binghamton Computer Science Department

iphone Programming Patrick H. Madden SUNY Binghamton Computer Science Department iphone Programming Patrick H. Madden SUNY Binghamton Computer Science Department pmadden@acm.org http://optimal.cs.binghamton.edu General Outline Overview of the tools, and where to get more information

More information

Praktikum Entwicklung von Mediensystemen mit ios

Praktikum Entwicklung von Mediensystemen mit ios Praktikum Entwicklung von Mediensystemen mit ios WS 2011 Prof. Dr. Michael Rohs michael.rohs@ifi.lmu.de MHCI Lab, LMU München Today Storyboards Automatic Reference Counting Animations Exercise 3 2 Timeline

More information

CS193P - Lecture 8. iphone Application Development. Scroll Views & Table Views

CS193P - Lecture 8. iphone Application Development. Scroll Views & Table Views CS193P - Lecture 8 iphone Application Development Scroll Views & Table Views Announcements Presence 1 due tomorrow (4/28)! Questions? Presence 2 due next Tuesday (5/5) Announcements Enrolled students who

More information

IOS - TEXT FIELD. Use of Text Field. Important Properties of Text Field. Updating Properties in xib

IOS - TEXT FIELD. Use of Text Field. Important Properties of Text Field. Updating Properties in xib IOS - TEXT FIELD http://www.tutorialspoint.com/ios/ios_ui_elements_text_field.htm Copyright tutorialspoint.com Use of Text Field A text field is a UI element that enables the app to get user input. A UITextfield

More information

ios Core Data Example Application

ios Core Data Example Application ios Core Data Example Application The Core Data framework provides an abstract, object oriented interface to database storage within ios applications. This does not require extensive knowledge of database

More information

Stanford CS193p. Developing Applications for ios. Fall Stanford CS193p. Fall 2011

Stanford CS193p. Developing Applications for ios. Fall Stanford CS193p. Fall 2011 Developing Applications for ios Today UI Element of the Week UIToolbar ipad Split View Popover Universal (iphone + ipad) Application Demo Friday Section AVFoundation framework - Capturing and manipulating

More information

Stanford CS193p. Developing Applications for iphone 4, ipod Touch, & ipad Fall Stanford CS193p Fall 2010

Stanford CS193p. Developing Applications for iphone 4, ipod Touch, & ipad Fall Stanford CS193p Fall 2010 Developing Applications for iphone 4, ipod Touch, & ipad Today One last Objective-C topic: Protocols Using protocols to define/implement/use a data source and/or delegate Views UIView and UIWindow classes

More information

Widget Tour. iphone and ipod touch Development Fall 2009 Lecture 7

Widget Tour. iphone and ipod touch Development Fall 2009 Lecture 7 Widget Tour iphone and ipod touch Development Fall 2009 Lecture 7 Questions? Announcements Assignment #2 due Tonight by 11:59pm Today s Topics Controls Buttons Switches Sliders Segmented Controls Text

More information

View Concepts. iphone Application Programming Lecture 4: User Interface Design. SDK provide many types of Views to show your content

View Concepts. iphone Application Programming Lecture 4: User Interface Design. SDK provide many types of Views to show your content View Concepts iphone Application Programming Lecture 4: User Interface Design SDK provide many types of Views to show your content At run-time Views are organized as a tree Chat Wacharamanotham Media Computing

More information

Today s Topics. Scroll views Table views. UITableViewController Table view cells. Displaying data Controlling appearance & behavior

Today s Topics. Scroll views Table views. UITableViewController Table view cells. Displaying data Controlling appearance & behavior Today s Topics Scroll views Table views Displaying data Controlling appearance & behavior UITableViewController Table view cells Scroll Views UIScrollView For displaying more content than can fit on the

More information

epicurious Anatomy of an ios app Robert Tolar Haining June 25, 2010 ConvergeSE

epicurious Anatomy of an ios app Robert Tolar Haining June 25, 2010 ConvergeSE epicurious Anatomy of an ios app Robert Tolar Haining June 25, 2010 ConvergeSE + = Prototype iphone ipad Why iphone apps Simplicity Control Speed Revenue Epicurious Defined as a Recipe Utility Cookbook

More information

Advanced ios. CSCI 4448/5448: Object-Oriented Analysis & Design Lecture 20 11/01/2012

Advanced ios. CSCI 4448/5448: Object-Oriented Analysis & Design Lecture 20 11/01/2012 Advanced ios CSCI 4448/5448: Object-Oriented Analysis & Design Lecture 20 11/01/2012 1 Goals of the Lecture Present a few additional topics and concepts related to ios programming persistence serialization

More information

CS193P: HelloPoly Walkthrough

CS193P: HelloPoly Walkthrough CS193P: HelloPoly Walkthrough Overview The goal of this walkthrough is to give you a fairly step by step path through building a simple Cocoa Touch application. You are encouraged to follow the walkthrough,

More information

Integrating Game Center into a BuzzTouch 1.5 app

Integrating Game Center into a BuzzTouch 1.5 app into a BuzzTouch 1.5 app This tutorial assumes you have created your app and downloaded the source code; created an App ID in the ios Provisioning Portal, and registered your app in itunes Connect. Step

More information

Assignment II: Foundation Calculator

Assignment II: Foundation Calculator Assignment II: Foundation Calculator Objective The goal of this assignment is to extend the CalculatorBrain from last week to allow inputting variables into the expression the user is typing into the calculator.

More information

MVC and Interface Builder IAP 2010

MVC and Interface Builder IAP 2010 MVC and Interface Builder IAP 2010 iphonedev.csail.mit.edu edward benson / eob@csail.mit.edu Information-Driven Applications Application Flow UIApplication Main NIB Initialized UIAppDelegate - (void)applicationdidfinishlaunching:(uiapplication

More information

Stanford CS193p. Developing Applications for ios. Fall CS193p. Fall

Stanford CS193p. Developing Applications for ios. Fall CS193p. Fall Stanford Developing Applications for ios Today More about Documents Demo Use Codable to create a JSON representation of our document Store it in the filesystem Think better of that and let UIDocument store

More information

ITP 342 Advanced Mobile App Dev. Memory

ITP 342 Advanced Mobile App Dev. Memory ITP 342 Advanced Mobile App Dev Memory Memory Management Objective-C provides two methods of application memory management. 1. In the method described in this guide, referred to as manual retain-release

More information

Life Cycle. Chapter Explore the Game Application. Understanding the Views in a Game

Life Cycle. Chapter Explore the Game Application. Understanding the Views in a Game 3 Chapter Explore the Game Application Life Cycle There is more to a game than just the fun parts. Almost all of the games on the market, and definitely the big titles, involve multiple views and a reasonably

More information

Intro to Native ios Development. Dave Koziol Arbormoon Software, Inc.

Intro to Native ios Development. Dave Koziol Arbormoon Software, Inc. Intro to Native ios Development Dave Koziol Arbormoon Software, Inc. About Me Long time Apple Developer (20 WWDCs) Organizer Ann Arbor CocoaHeads President & ios Developer at Arbormoon Software Inc. Wunder

More information

CS193P - Lecture 7. iphone Application Development. Navigation & Tab Bar Controllers

CS193P - Lecture 7. iphone Application Development. Navigation & Tab Bar Controllers CS193P - Lecture 7 iphone Application Development Navigation & Tab Bar Controllers 1 Announcements Assignment 3 is due tomorrow Paparazzi 1 is due on Wednesday February 3rd 2 Today s Topics Navigation

More information

iphone Application Programming Lab 2: MVC and Delegation + A01 discussion

iphone Application Programming Lab 2: MVC and Delegation + A01 discussion Lab 2: MVC and Delegation + A01 discussion Nur Al-huda Hamdan RWTH Aachen University Winter Semester 2015/2016 http://hci.rwth-aachen.de/iphone Learning Objectives Discuss A01 + demo Concepts: debugging

More information

Assignment III: Graphing Calculator

Assignment III: Graphing Calculator Assignment III: Graphing Calculator Objective The goal of this assignment is to reuse your CalculatorBrain and CalculatorViewController objects to build a Graphing Calculator for iphone and ipad. By doing

More information

Assignment IV: Smashtag Mentions

Assignment IV: Smashtag Mentions Assignment IV: Smashtag Mentions Objective In this assignment, you will enhance the Smashtag application that we built in class to give ready-access to hashtags, urls, images and users mentioned in a tweet.

More information

src3/bettertextfield/bettertextfield/appdelegate.h // AppDelegate.h // BetterTextField

src3/bettertextfield/bettertextfield/appdelegate.h // AppDelegate.h // BetterTextField src3/bettertextfield/bettertextfield/appdelegate.h 1 1 1 1 AppDelegate.h BetterTextField Created by Tommy MacWilliam on 3/7/ Copyright (c) 2012 MyCompanyName. All rights reserved. #import

More information

InterfaceBuilder and user interfaces

InterfaceBuilder and user interfaces ES3 Lab 2 InterfaceBuilder and user interfaces This lab InterfaceBuilder Creating components Linking them to your code Adding buttons, labels, sliders UITableView Creating a tableview Customizing cells

More information

1 Build Your First App. The way to get started is to quit talking and begin doing. Walt Disney

1 Build Your First App. The way to get started is to quit talking and begin doing. Walt Disney 1 Build Your First App The way to get started is to quit talking and begin doing. Walt Disney Copyright 2015 AppCoda Limited All rights reserved. Please do not distribute or share without permission. No

More information

Stanford CS193p. Developing Applications for ios. Spring CS193p. Spring 2016

Stanford CS193p. Developing Applications for ios. Spring CS193p. Spring 2016 Stanford Developing Applications for ios Today Views Custom Drawing Demo FaceView Views A view (i.e. UIView subclass) represents a rectangular area Defines a coordinate space For drawing And for handling

More information

CUSTOM VIEWS. The View Hierarchy. Chapter 12

CUSTOM VIEWS. The View Hierarchy. Chapter 12 Chapter 12 CUSTOM VIEWS A ll the visible objects in an application are either windows or views. In this chapter, you will create a subclass of NSView. From time to time, you will create a custom view to

More information

CS193E Lecture 7. Document-based Applications NSTableView Key-Value Coding

CS193E Lecture 7. Document-based Applications NSTableView Key-Value Coding CS193E Lecture 7 Document-based Applications NSTableView Key-Value Coding Agenda Questions? Review: delegates, MVC Document-based apps Table views Key Value Coding Model, View, Controller Controller Model

More information

Objective-C Primer. iphone Programmer s Association. Lorenzo Swank September 10, 2008

Objective-C Primer. iphone Programmer s Association. Lorenzo Swank September 10, 2008 Objective-C Primer iphone Programmer s Association Lorenzo Swank September 10, 2008 Disclaimer Content was blatantly and unapologetically stolen from the WWDC 2007 Fundamentals of Cocoa session, as well

More information

MVC & Onwards. CS 442: Mobile App Development Michael Saelee

MVC & Onwards. CS 442: Mobile App Development Michael Saelee MVC & Onwards CS 442: Mobile App Development Michael Saelee Agenda - Recap: view-controller communication - Delegation as a general pattern - Observer pattern - Controller responsibilities & MVC - Multiple

More information

Mobile Application Development

Mobile Application Development Mobile Application Development Lecture 16 Controllers of View Controllers 2013/2014 Parma Università degli Studi di Parma Lecture Summary Multiple MVCs UINavigationController Segues UITabBarController

More information

Stanford CS193p. Developing Applications for ios. Fall Stanford CS193p. Fall 2011

Stanford CS193p. Developing Applications for ios. Fall Stanford CS193p. Fall 2011 Developing Applications for ios Views A view (i.e. UIView subclass) represents a rectangular area Defines a coordinate space Draws and handles events in that rectangle Hierarchical A view has only one

More information

Introductory ios Development

Introductory ios Development Introductory ios Development 152-164 Unit 5 - Multi-View Apps Quick Links & Text References What is a Delegate? What is a Protocol? Delegates, Protocols and TableViews Creating a Master-Detail App Modifying

More information

AVAudioPlayer. avtouch Application

AVAudioPlayer. avtouch Application AVAudioPlayer avtouch Application iphone Application Index 1. iphone Application 1) iphone Application 2) iphone Application Main Method 3) iphone Application nib(.xib) 2. avtouch Application 1) avtouch

More information

View Concepts. iphone Application Programming Lecture 4: User Interface Design. SDK provide many types of Views to show your content

View Concepts. iphone Application Programming Lecture 4: User Interface Design. SDK provide many types of Views to show your content View Concepts iphone Application Programming Lecture 4: User Interface Design SDK provide many types of Views to show your content At run-time Views are organized as a tree Chat Wacharamanotham Media Computing

More information

COMP327 Mobile Computing. Lecture Set 9 - Model, View, Controller

COMP327 Mobile Computing. Lecture Set 9 - Model, View, Controller COMP327 Mobile Computing Lecture Set 9 - Model, View, Controller 1 In this Lecture Set Anatomy of an Application Model View Controller Interface Builder and Nibs View Classes Views Drawing Text and Images

More information

A Vertical Slider for iphone

A Vertical Slider for iphone A Vertical Slider for iphone The UISlider control offers a way to continuously get values from the user within a range of set values. In the Interface Builder library of controls, there is only a horizontal

More information

AVAudioRecorder & System Sound Services

AVAudioRecorder & System Sound Services AVAudioRecorder & System Sound Services Dept. of Multimedia Science, Sookmyung Women s University. prof. JongWoo Lee Index AVAudioRecorder? - (AudioRecorder) System Sound Service? - (SysSound) AVAudioRecorder

More information

Stanford CS193p. Developing Applications for ios. Spring CS193p. Spring 2016

Stanford CS193p. Developing Applications for ios. Spring CS193p. Spring 2016 Stanford Developing Applications for ios Today Memory Management for Reference Types Controlling when things leave the heap Closure Capture Closures capture things into the heap too Extensions A simple,

More information

A Mad Libs app that you will navigate through 3 UIViewControllers to add text that will be shown in a story on the fourth UIViewController.

A Mad Libs app that you will navigate through 3 UIViewControllers to add text that will be shown in a story on the fourth UIViewController. WordPlay App: A Mad Libs app that you will navigate through 3 UIViewControllers to add text that will be shown in a story on the fourth UIViewController. Create a new project Create a new Xcode project

More information

Key Value Observing (KVO) CPRE 388

Key Value Observing (KVO) CPRE 388 Key Value Observing (KVO) CPRE 388 MyObservedClass MyObserving Class Observed Property P Observer Callback Method Key Value Observing KVO is a mechanism that allows objects to be notified of changes to

More information

Assignment I Walkthrough

Assignment I Walkthrough Assignment I Walkthrough Objective Reproduce the demonstration (building a calculator) given in class. Materials By this point, you should have been sent an invitation to your sunet e-mail to join the

More information

Assignment III: Graphing Calculator

Assignment III: Graphing Calculator Assignment III: Graphing Calculator Objective You will enhance your Calculator to create a graph of the program the user has entered which can be zoomed in on and panned around. Your app will now work

More information

CS193p Spring 2010 Monday, April 12, 2010

CS193p Spring 2010 Monday, April 12, 2010 CS193p Spring 2010 Announcements Axess! Make sure your grading option matches what you were approved for Sonali s Office Hours Changed Friday 11am to 1pm Thursday 10am to noon Gates B26B Any questions

More information

Building an Application

Building an Application Building an Application 7 Anatomy of an Application Compiled code Your code Frameworks Nib files UI elements and other objects Details about object relationships Resources (images, sounds, strings, etc)

More information

Data IAP 2010 iphonedev.csail.mit.edu edward benson / Thursday, January 14, 2010

Data IAP 2010 iphonedev.csail.mit.edu edward benson / Thursday, January 14, 2010 Data IAP 2010 iphonedev.csail.mit.edu edward benson / eob@csail.mit.edu Today Property Lists User Defaults Settings Panels CoreData Property Lists Today Add persistence. plist 1. Using Property Lists in

More information

INTRODUCTION TO ARCHITECTING YOUR IOS APP

INTRODUCTION TO ARCHITECTING YOUR IOS APP INTRODUCTION TO ARCHITECTING YOUR IOS APP AGENDA Goals of software architecture Design guidelines Practical tips GOALS OF SOFTWARE ARCHITECTURE GOALS OF SOFTWARE ARCHITECTURE Code is comprehensible for

More information

ios Development Lecture 3 Controllers of View Controllers Ing. Simone Cirani

ios Development Lecture 3 Controllers of View Controllers Ing. Simone Cirani ios Development Lecture 3 Controllers of View Controllers Ing. Simone Cirani email: simone.cirani@unipr.it http://www.tlc.unipr.it/cirani Corso IFTS Cisita ios Development 2014 Parma Università degli Studi

More information

Stanford CS193p. Developing Applications for ios. Winter CS193p. Winter 2017

Stanford CS193p. Developing Applications for ios. Winter CS193p. Winter 2017 Stanford Developing Applications for ios Today Views Custom Drawing Demo FaceView Views A view (i.e. UIView subclass) represents a rectangular area Defines a coordinate space For drawing And for handling

More information

Views. A view (i.e. UIView subclass) represents a rectangular area Defines a coordinate space

Views. A view (i.e. UIView subclass) represents a rectangular area Defines a coordinate space Views A view (i.e. UIView subclass) represents a rectangular area Defines a coordinate space Draws and handles events in that rectangle Hierarchical A view has only one superview - (UIView *)superview

More information

IPHONE DEVELOPMENT. Getting Started with the iphone SDK

IPHONE DEVELOPMENT. Getting Started with the iphone SDK IPHONE DEVELOPMENT Getting Started with the iphone SDK OBJECTIVE-C The Big Picture STRICT SUPERSET OF C The Objective C Language Any C stuff applies Standard libs are here (time, sqrt etc) The C Language

More information

UICollectionView. NSCoder Milwaukee. 2 April John Psuik. Tuesday, April 2, 13

UICollectionView. NSCoder Milwaukee. 2 April John Psuik. Tuesday, April 2, 13 UICollectionView NSCoder Milwaukee 2 April 2013 John Psuik 1 UICollectionView New to ios 6 Layouts determine placement of items (flowlayout and custom layout) UITableView concepts, but you can do so much

More information

Stanford CS193p. Developing Applications for ios. Winter CS193p! Winter 2015

Stanford CS193p. Developing Applications for ios. Winter CS193p! Winter 2015 Stanford CS193p Developing Applications for ios Today Objective-C Compatibility Bridging Property List NSUserDefaults Demo: var program in CalculatorBrain Views Custom Drawing Demo FaceView Bridging Objective-C

More information

imate: ios Application

imate: ios Application imate: ios Application Document Version 1.0.1 Date: 27 th May, 2014 2 [IMATE: IOS APPLICATION] Contents AppDelegate Class Reference... 4 Tasks... 4 Properties... 4 Instance Methods... 4 ChatMenuViewController

More information

A Better MVC. 300 line view controllers or bust. Dave A guy who thinks too deeply about stuff

A Better MVC. 300 line view controllers or bust. Dave A guy who thinks too deeply about stuff A Better MVC 300 line view controllers or bust Dave DeLong @davedelong A guy who thinks too deeply about stuff Heads Up This is all my opinion (! hi legal & pr teams!) Lots of similar terminology View

More information

Stanford CS193p. Developing Applications for ios Fall Stanford CS193p. Fall 2013

Stanford CS193p. Developing Applications for ios Fall Stanford CS193p. Fall 2013 Developing Applications for ios -14 Today What is this class all about? Description Prerequisites Homework / Final Project ios Overview What s in ios? MVC Object-Oriented Design Concept Objective C (Time

More information

ios Memory Deep Dive #WWDC18 Kyle Howarth, Software Engineer James Snee, Software Engineer Kris Markel, Software Engineer

ios Memory Deep Dive #WWDC18 Kyle Howarth, Software Engineer James Snee, Software Engineer Kris Markel, Software Engineer Session #WWDC18 ios Memory Deep Dive 416 Kyle Howarth, Software Engineer James Snee, Software Engineer Kris Markel, Software Engineer 2018 Apple Inc. All rights reserved. Redistribution or public display

More information

Monday, 1 November The ios System

Monday, 1 November The ios System The ios System System Overview System Overview System Overview System Overview System Overview System Overview Foundation Classes (Useful) Foundation Framework Value and collection classes User defaults

More information

Developing Applications for ios

Developing Applications for ios Developing Applications for ios Lab 2: RPN Calculator App (1 of 3) Radu Ionescu raducu.ionescu@gmail.com Faculty of Mathematics and Computer Science University of Bucharest Task 1 Task: Create a new application

More information

Contents. iphone Training. Industry Trainers. Classroom Training Online Training ON-DEMAND Training. Read what you need

Contents. iphone Training. Industry Trainers. Classroom Training Online Training ON-DEMAND Training. Read what you need iphone Training Contents About iphone Training Our ios training classes can help you get off to a running start in iphone, ipod and ipad app development. Learn from expert Objective-C developers with years

More information

Computer Science 251. iphone Application Development. Autorotation, Popover Controllers, Modal Controllers

Computer Science 251. iphone Application Development. Autorotation, Popover Controllers, Modal Controllers Computer Science 251 iphone Application Development Autorotation, Popover Controllers, Modal Controllers Two Types of Orientation Device: physically upside down, rotated left, on its back, etc. Can be

More information

Event Delivery: The Responder Chain

Event Delivery: The Responder Chain When you design your app, it s likely that you want to respond to events dynamically. For example, a touch can occur in many different objects onscreen, and you have to decide which object you want to

More information

Scroll View School Hands-On Challenges

Scroll View School Hands-On Challenges Scroll View School Hands-On Challenges Copyright 2014 Razeware LLC. All rights reserved. No part of this book or corresponding materials (such as text, images, or source code) may be reproduced or distributed

More information

My First Cocoa Program

My First Cocoa Program My First Cocoa Program 1. Tutorial Overview In this tutorial, you re going to create a very simple Cocoa application for the Mac. Unlike a line-command program, a Cocoa program uses a graphical window

More information

ios Mobile Development

ios Mobile Development ios Mobile Development Today UITableView! Data source-driven vertical list of views.! ipad! Device-specific UI idioms.! Demo! Shutterbug UITableView Very important class for displaying data in a table!

More information

Tip Calculator App Introducing Swift, Text Fields, Sliders, Outlets, Actions, View Controllers, Event Handling, NSDecimalNumber,

Tip Calculator App Introducing Swift, Text Fields, Sliders, Outlets, Actions, View Controllers, Event Handling, NSDecimalNumber, 3 Tip Calculator App Introducing Swift, Text Fields, Sliders, Outlets, Actions, View Controllers, Event Handling, NSDecimalNumber, NSNumberFormatter and Automatic Reference Counting Objectives In this

More information

Objectives. Submission. Register for an Apple account. Notes on Saving Projects. Xcode Shortcuts. CprE 388 Lab 1: Introduction to Xcode

Objectives. Submission. Register for an Apple account. Notes on Saving Projects. Xcode Shortcuts. CprE 388 Lab 1: Introduction to Xcode Objectives Register for an Apple account Create an application using Xcode Test your application with the iphone simulator Import certificates for development Build your application to the device Expand

More information

CS193P - Lecture 10. iphone Application Development. Performance

CS193P - Lecture 10. iphone Application Development. Performance CS193P - Lecture 10 iphone Application Development Performance 1 Announcements 2 Announcements Paparazzi 2 is due next Wednesday at 11:59pm 2 Announcements Paparazzi 2 is due next Wednesday at 11:59pm

More information

ITP 342 Mobile App Development. Model View Controller

ITP 342 Mobile App Development. Model View Controller ITP 342 Mobile App Development Model View Controller Design Patterns A reusable pattern to solve common issues that come up in software development NOT new syntax, but the way you design your program What

More information

COPYRIGHTED MATERIAL. part I Developing a Professional UI. Chapter 1: Creating a Personal Library. Chapter 2: Advancing with Tableviews

COPYRIGHTED MATERIAL. part I Developing a Professional UI. Chapter 1: Creating a Personal Library. Chapter 2: Advancing with Tableviews part I Developing a Professional UI Chapter 1: Creating a Personal Library Chapter 2: Advancing with Tableviews Chapter 3: Advancing with Map Kit Chapter 4: Understanding Action Views and Alerts Chapter

More information

Collection Views. Dr. Sarah Abraham

Collection Views. Dr. Sarah Abraham Collection Views Dr. Sarah Abraham University of Texas at Austin CS329e Fall 2016 What is a Collection View? Presents an ordered set of data items in a flexible layout Subclass of UIScrollView (like UITableView)

More information

lecture 10 UI/UX and Programmatic Design cs : spring 2018

lecture 10 UI/UX and Programmatic Design cs : spring 2018 lecture 10 UI/UX and Programmatic Design cs198-001 : spring 2018 1 Announcements custom app progress form due before lab (~1 minute) will be released after lecture only 2 labs left (both very important)

More information

Create an App that will drop PushPins onto a map based on addresses that the user inputs.

Create an App that will drop PushPins onto a map based on addresses that the user inputs. Overview Create an App that will drop PushPins onto a map based on addresses that the user inputs. Part 1: Introduction to MKMapKit Part 2: Introduction to PushPins Part 3: Use Google s API to lookup an

More information

lectures/2/src2/nib1/nib1/appdelegate.h // AppDelegate.h // Nib1 // David J. Malan // Harvard University //

lectures/2/src2/nib1/nib1/appdelegate.h // AppDelegate.h // Nib1 // David J. Malan // Harvard University // lectures/2/src2/nib1/nib1/appdelegate.h 1 1 1 1 1 1 1 1 1 2 AppDelegate.h Nib1 David J. Malan Harvard University malan@harvard.edu Demonstrates a Single View Application implemented with a nib, plus IBAction

More information