Corrections and version notes

Size: px
Start display at page:

Download "Corrections and version notes"

Transcription

1 Last updated 7 th May, 2014 Programming apps for the iphone Corrections and version notes Please feel free to Graeme (gbsummers@graemesummers.info) for additional help or clarification on any of the following. Specific Corrections For ALL programming examples refer to Xcode version notes that apply to the version you are using (starting on page 4 of these notes). Programming example 1 Page 26: There needs to be a 2 nd action connection (as shown on the Received Actions on page 27). From the Touch Up Inside event radio button of the Hide button, connect to hidegreeting. Programming example 3 Page 60: Point 6. If using Xcode 4.4 or later, there are ten keyboards. The additional two are Decimal Pad and Twitter. Page 61: Point 10 should read: Controls can be classified as active, static or passive. Page 62: If using Xcode 4.4 or later, the question should read What seven keyboards...? Programming example 4 Page 72: The 3 rd bullet point under Build and run on the ios simulator should read: Stop running Running Wolf then Quit the ios Simulator. Page 77: If using Xcode 5 or later: Question 10 suggests using the Touch Down event with the UISwitch. With the new UISwitch in ios 7 you should use the Value Changed event. Programming example 5 Page 80, 83: It should be noted that iphones 1 to 4 have a height of 480 but iphone 5 has a height of 568. So, if coding for iphone 5, the starting X attribute for each ImageView should be 466. Likewise, in the implementation file, if coding for iphone 5, the code in the resetcars method should read: xposred = ; xposblue = ; If coding for iphone 5, the code in the movecars method should read: xposred = ;... xposblue = ; Note that the height of any iphone or ipad can be coded: [[UIScreen mainscreen] bounds].size.height Page 84: If using Xcode 4.5 or later refer to the version notes concerning landscape orientation. Page 85: The 3 rd bullet point under Build and run on the ios simulator should read: Stop running Rally Cars then Quit the ios Simulator. 1

2 Programming example 6 Page 94: If using Xcode 5 or later, the tag attribute has the long data type, so the declarations and assignments for userchoice, iphonechoice and result must read: long userchoice = sender.tag; long iphonechoice = arc4random() % 3; // 0, 1 or 2 long result = iphonechoice - userchoice; So the assignments for the image names must contain placeholders for long values (%ld): NSString *userimagename = [NSString %ld.png",userchoice]; NSString *iphoneimagename = [NSString %ld.png",iphonechoice]; Page 95: If using Xcode 5 or later, remove [alert release]; No releases are required when using ARC (Automatic Reference Counting). Page 96: The 3 rd bullet point under Build and run on the ios simulator should read: Stop running Paper, Rock, Scissors then Quit the ios Simulator. Page 100: If using Xcode 5 or later: Question 6 involves the use of a segmented control. Refer to the version notes for Xcode 5 under More on images. Programming example 7 Page 109: The 3 rd bullet point under Build and run on the ios simulator should read: Stop running Word Count then Quit the ios Simulator. Programming example 8 Page 122: The 3 rd bullet point under Build and run on the ios simulator should read: Stop running Fibonacci then Quit the ios Simulator. Arrays Page 129: The array of NSString should be enclosed in square brackets: NSArray *trinums = nil]; The array of primitive C integers should have included the same numbers 1, 3, 6, 10, also enclosed in square brackets: NSArray *trinums = [NSArray arraywithobjects:[nsnumber numberwithint:1], [NSNumber numberwithint:3], [NSNumber numberwithint:6], [NSNumber numberwithint:10], nil]; For the above arrays take note of the alternatives for assigning literals made available in Xcode version 4.4 and later. Programming example 10 Page 149: If using Xcode 5 or later the variables firstindex and secondindex should be declared long. Page 152: If using Xcode 5 or later the variable correctmatch should be declared long. 2

3 Page 154: If using Xcode 5 or later: the method newgame is called in the last line of viewdidload. In ios 7 the view is loaded too soon for newgame to be executed. So the method viewdidappear must be used for this: -(void)viewdidappear:(bool)animated { [self newgame]; } Add this code to the implementation file. This same issue will apply to the Eight application (Quest. 10, p 159) Touches and Gestures If using Xcode 5 or later refer to the notes on BallDrag2 and Cup Cakes. Programming example 11 Page 182: If using Xcode 4.5 or later refer to the version notes concerning landscape orientation. Page 182: The 3 rd bullet point under Build and run on the ios simulator should read: Stop running Cup Cakes then Quit the ios Simulator. Page 183: When choosing a template for your new file (for Xcode 4.3 or later): Choose Objective-C class. The option UIViewController subclass has been bundled in with other Objective-C class templates. Then select UIViewController as subclass. You will also need to check with xib for user interface. Pages 187, 188: If using Xcode 4.6 or later refer to version notes concerning presenting and dismissing view controllers. If using Xcode 5 or later refer to version notes concerning Gesture Recognizers and Moving between scenes (segues). 3

4 Version notes for Xcode 4.3 or later What was referred to as a View-Based Application is now a Single View Application. When choosing options for your new project note the example shown below: o Enter the Class Prefix the same as the Product Name. o Leave all three check boxes unchecked (Use Storyboards, Use Automatic Reference Counting, Include Unit Tests). Labels (UILabel) no longer have the Adjust to Fit attribute in the Attributes Inspector. When checked this resulted in text shrinking to fit the available frame size. The Autoshrink attribute (in Xcode 4.3 or later) will serve the same purpose (as well as being able to set a minimum font size). dealloc does not appear in the implementation template. But as we are not using ARC (Automatic Reference Counting) then go ahead and include the dealloc method as shown in the is included in the implementation template (to implement private methods and class extensions). This will not be used in any projects in this book. When choosing a template for a New File the option UIViewController subclass has been bundled in with other Objective-C class templates. So select Objective-C class first and then select UIViewController as subclass (see Programming example 11 corrections). 4

5 Version notes for Xcode 4.4 or later String literals, first seen on page 27, show text data between double quotes and preceded by A simpler alternative method to express other literals has been introduced in version 4.4 of Xcode. NSArray literals can now be populated using a simpler syntax: NSArray The objects in the array are between square brackets that are preceded by character. Compare with the example given on page 129. Note that it is no longer necessary to include a terminating nil. A simpler alternative to express NSNumber literals greatly simplifies arrays with NSNumber objects. Previously an NSNumber being assigned a primitive C type required methods like numberwithint. For example NSNumber *howmany; howmany = [NSNumber numberwithint:345]; Now there is the alternative of expressing the literal in a simpler way: NSNumber *howmany; howmany Note also the simpler alternative for other primitive C types being assigned at literals to NSNumbers. Examples for float and BOOL are given below: NSNumber *whatever; whatever NSNumber *response; Response This simplifies arrays with primitive C types. It was stated on page 129 that there is no easy way to add primitive C types to an NSArray. There wasn t until version 4.4: NSArray @synthesize is auto-generated. However it is recommended that this be included in the implementation file as shown in all examples. 5

6 Version notes for Xcode 4.5 or later The method shouldautorotatetointerfaceorientation in the implementation file is no longer supported in Xcode 4.5 or later and is not included in the template. This method was used in Examples 5 and 11 where landscape orientation was required (also in exercises on pages 88, 101, 102, 114, 126, 142, 143, 191). Instead use the following method: - (NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskLandscape; } Note that in the Help view of Cup Cakes the orientation is portrait. So this method must return UIInterfaceOrientationMaskPortrait. The view can be set to the taller iphone 5 size (4 inches) or the size of the previous models (3.5 inches). Attribute settings for the view in the xib and settings in the ios simulator have to be consistent. For the 3.5 inch height (used for all examples in this book): Set the Size attribute of the view to None ios simulator > Hardware > Device > iphone ios simulator > Window > Scale > 100% For the 4 inch height: Set the Size attribute of the view to Retina 4 (Full Screen) ios simulator > Hardware > Device > iphone (Retina 4-inch) ios simulator > Window > Scale > 50% The viewdidunload method does not appear as part of the Xcode 4.5 (or later) template in implementation files. So if required it has to be added manually. For all the projects in this book we do not use ARC (Automatic Reference Counting); instead we use MRR (Memory Retain-Release) so I recommend using the dealloc and viewdidunload methods as shown in each example, however you may now choose to omit. 6

7 Version notes for Xcode 4.6 or later Xcode 4.6 adds support for ios 6.1 In support of iphone retina screens the file Default.png, copied to the Supporting Files folder in each project, should be named: If the file is not present Xcode will suggest adding one for you. The viewdidunload method was called when the controller s view was released from memory. It has been deprecated ion ios 6, so this method is no longer required in any of the projects. For projects with multiple views, the first example being Cup Cakes Example 11, the methods for presenting and dismissing view controllers has changed a little. The following methods should be used if the Deployment Target is ios 6.1 or later. Page 188: Previously [self presentmodalviewcontroller:helpview animated:yes]; Now [self presentviewcontroller:helpview animated:yes completion:nil]; Page 187: Previously [self dismissmodalviewcontrolleranimated:yes]; Now [self dismissviewcontrolleranimated:yes completion:nil]; If you open a project that was created with an earlier version of Xcode you will have the opportunity to migrate. Xcode 4.6 has a new version compiler and debugger (LLVM and LLDB). While Xcode 4.6 does still support the previous compiler and debugger it might be wise to bring all your work up to date. The first thing you will notice when you open an old project is a yellow triangular warning as the project loads: The example above indicates one issue. You might have a second issue with the Default png (2 nd bullet point above). Click on the yellow triangle and the issue(s) will be displayed: 7

8 Before dealing with the compiler-debugger issue click on the project icon to set the ios deployment target to 6.1 as shown below: Then click on Validate Project Settings. You will see the following window: Click on the Perform Changes button. Xcode versions 4.6.1, and are responses to various developer issues, none that require responses beyond what was listed above for Xcode

9 Version notes for Xcode 5.1 or later Xcode 5 adds support for ios 7. The most noticeable changes are in the early stages of creating a project. Despite the fact that Xcode 5 has introduced notable changes to its environment, the steps taken to create an application remain the same: Create the project Add images Create the interface Write the header code Make the outlet and action connections Write the implementation code Create the project For all the examples in the book we start with a Single View Application when choosing a template. We will use the Paper Rock Scissors example in these notes. 9

10 You will notice you have no choice when it comes to using storyboards or ARC (Automatic Reference Counting), both are used in Xcode 5. You will see, in the notes to follow, that ARC reduces the amount of code. The code that was used with MRR (Memory Retain-Release) is no longer required. When you enter the Xcode workspace the Deployment Info is displayed. Set the Deployment Target at 7.1. The Device Orientation(s) required should be checked. For Paper Rock Scissors only Portrait is selected. Add images In previous versions of Xcode required images were placed in the Supporting Files folder. They are now organized in Images.xcassets. 10

11 The application icon in ios 7 has to be a png pixels and named icon@2x.png. Drag it from its source to the dotted frame titled iphone App ios7, as shown below. The launch images have to suit the model iphone and be named for use in ios 7. For iphone 4 Retina using ios 7 the image must be a png pixels and named Default_iOS7@2x.png. For iphone 5 Retina using ios 7 the image must be a png pixels and named Default_iOS7-568h@2x.png. Drag them from their sources to the 2x and R4 (Retina 4 inch) dotted frames respectively. 11

12 All other images required for the application should be dragged on below the LaunchImage folder. The last 3 characters in the name should For example PRS 0@2x.png. Create the interface Now the interface can be created. This is done in the same way as with an xib, by selecting the storyboard (Main.storyboard). Show the File Inspector, as shown above. Deselect the Use Auto Layout checkbox. There is a lot of detail associated with Auto Layout and it is not covered in this edition of the book. 12

13 Drag on the controls from the Object Library and set the attributes as described in the book. Write the code to make header declarations There are minor variations to the code in Paper_Rock_ScissorsViewController.h. Before Xcode 5 the code looked like this: #import Paper_Rock_ScissorsViewController : UIViewController { UIButton *btnpaper, *btnrock, *btnscissors; UIImageView *imvuser, *imviphone; UILabel *lblwins, *lbldraws, *lbllosses; } int wins, draws, nonatomic) IBOutlet UIButton *btnpaper, *btnrock, nonatomic) IBOutlet UIImageView *imvuser, nonatomic) IBOutlet UILabel *lblwins, *lbldraws, *lbllosses; - (IBAction)buttonPress:(UIButton 13

14 With Xcode 5 the code looks like this: #import Paper_Rock_ScissorsViewController : UIViewController { UIButton *btnpaper, *btnrock, *btnscissors; UIImageView *imvuser, *imviphone; UILabel *lblwins, *lbldraws, *lbllosses; } int wins, draws, nonatomic) IBOutlet UIButton nonatomic) IBOutlet UIButton nonatomic) IBOutlet UIButton nonatomic) IBOutlet UIImageView nonatomic) IBOutlet UIImageView nonatomic) IBOutlet UILabel nonatomic) IBOutlet UILabel nonatomic) IBOutlet UILabel *lbllosses; - (IBAction)buttonPress:(UIButton Notice the property declarations are made one object at a time. You will see how this makes the Outlet connections very easy to perform. The keyword retain has been replaced with strong. If you were to use retain it would still work fine. More will be said about this when discussing ARC. Make connections to the outlets and actions Create an extra pane by clicking Show the Assistant editor button. 14

15 The buttons allow you to scroll through the storyboard and code files. Scroll so that you have the storyboard in one pane and the header code in the other. Make connections to the outlets by dragging from the radio button beside each property declaration to its corresponding control on the storyboard. Do this for each declared button, imageview and label, as shown above. To make connections to the actions right-click the buttons one at a time to reveal all the possible actions. Then drag from the radio button beside the action to the centre of the IBAction declaration in the header. Note: you are dragging in the opposite direction to the outlet connections. Do this for each of the buttons that will use this method. 15

16 Remove the Assistant editor. You can check that all the outlet and action connections have been done correctly by using the Connections Inspector. Below the storyboard is a bar with three icons. The left icon is the Files Owner. Select this icon the click the Show the Connections inspector button as shown below. You will see all the connections displayed. 16

17 Write the code for the implementation There are very few changes to the implementation code, mainly omissions. With ARC the following methods do not exist: - (void)dealloc - (void)viewdidunload In some examples an object is explicitly released. In Paper Rock Scissors : [alert release]; With ARC this is not to be used as objects are automatically released. MRR could be used prior to Xcode 5. The RR stands for Retain-Release. The keyword retain has been replaced with strong in the property declarations. This is a way of distancing from MMR (no retain, no release). More on images Segmented control There is an issue with the use of images in the ios 7 segmented control. Images loaded into the segments will not display correctly unless there is an adjustment of the rendering mode. As an example, question 6 on page 100 suggests the use of a UISegmentedControl. When the images are first added they look like they are completely blue with no definition. Each image has to be re-rendered and added back to the control (!!!). The following code added to the ViewDidLoad method will do the trick: for(int i=0; i<5; i++) { UIImage *imgold = [scgpick imageforsegmentatindex:i]; UIImage *imgnew = [imgold imagewithrenderingmode:uiimagerenderingmodealwaysoriginal]; [self.scgpick setimage:imgnew forsegmentatindex:i]; } Launch images in landscape orientation Launch images in ios 7 for the iphone can only be in portrait orientation. So when the orientation for the opening view is landscape the launch image will not be displayed. A way around this is to have the opening view in portrait orientation then immediately switch it to landscape when the view first appears. To do this the following import command needs to be added to the implementation file: #import <objc/message.h> as well as the following method: -(void)viewdidappear:(bool)animated { objc_msgsend([uidevice } 17

18 Gesture recognizers Creating recognizers without code This is best demonstrated using the DragBall2 example. In the Object Library there is an object for each of the gestures. Instead of creating a recognizer with code in the ViewDidLoad method (though it can still be done this way), the appropriate object can be dragged onto the control that that requires a gesture. For DragBall2 a Pan Gesture Recognizer is dragged onto the image view containing the basketball: Then the recognizer must be connected to a declared action in the header file. Right click on the recognizer in the bar below the scene, drag from the Sent Actions button to the Action. 18

19 Note that there is no need to declare a variable for the ImageView, or a property declaration in the header file The code in the implementation is a little simpler too. No synthesize required for the ImageView, just the code for the method handling the pan. - (IBAction)handlePan:(UIPanGestureRecognizer *)recognizer { // store translation in a CGPoint CGPoint translation = [recognizer translationinview:self.view]; // relocate centre of ball with translation recognizer.view.center = CGPointMake(recognizer.view.center.x + translation.x, recognizer.view.center.y + translation.y); // must set translation back to (0, 0) [recognizer settranslation:cgpointzero inview:self.view]; } Make sure the ImageView has User Interaction enabled. Gesture recognizers in Cup Cakes With nine controls to pan the code in both the header and implementation files is greatly reduced when creating gesture recognizers from the Object Library. Like DragBall2 there is no need for variables for each of the ImageViews, or property declarations in the header file. The implementation file doesn t require a synthesize statement or any of the code in ViewDidLoad. Add a Pan Gesture Recognizer to each of the nine controls. 19

20 With so many recognizers on the one scene creating connections to the Action is easier done using Document Outline. There is a button at the bottom of the centre pane that will show/hide the Document Outline. 20

21 Each of the nine recognizers can be connected to the Action after a Right Click and a drag. The same method used in DragBall2 can be used in Cup Cakes implementation. - (IBAction)handlePan:(UIPanGestureRecognizer *)recognizer { // store translation in a CGPoint CGPoint translation = [recognizer translationinview:self.view]; // relocate centre of ball with translation recognizer.view.center = CGPointMake(recognizer.view.center.x + translation.x, recognizer.view.center.y + translation.y); // must set translation back to (0, 0) [recognizer settranslation:cgpointzero inview:self.view]; } 21

22 Moving between scenes (segues) Adding an additional scene in Cup Cakes A New File can be added to the project as before, however choose NOT to Also create an XIB file ; we will be adding a new view from the Object Library. Drag on another View Controller from the Object Library. Select the new view and show the Identity Inspector in the right pane. Choose the newly created HelpViewController for its class. 22

23 Select the View Controller icon in the bar below the view, set its Orientation to Landscape. Add all the required controls. Adding a segue Right Click the Help button. Drag from the Triggered Segues action button to the Help view. Choose Modal. 23

24 A segue is created. A segue to go from Help back to the starting scene is created in the same way. Attributes of the segue can be set by selecting the segue button and then displaying the Attributes Inspector. You might want to change the type of Transition.. 24

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

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

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

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

In the first class, you'll learn how to create a simple single-view app, following a 3-step process:

In the first class, you'll learn how to create a simple single-view app, following a 3-step process: Class 1 In the first class, you'll learn how to create a simple single-view app, following a 3-step process: 1. Design the app's user interface (UI) in Xcode's storyboard. 2. Open the assistant editor,

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

ITP 342 Mobile App Dev. Interface Builder in Xcode

ITP 342 Mobile App Dev. Interface Builder in Xcode ITP 342 Mobile App Dev Interface Builder in Xcode New Project From the Main Menu, select the File à New à Project option For the template, make sure Application is selected under ios on the left-hand side

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

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

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

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

ITP 342 Mobile App Dev. Connections

ITP 342 Mobile App Dev. Connections ITP 342 Mobile App Dev Connections User Interface Interactions First project displayed information to the user, but there was no interaction. We want the users of our app to touch UI components such as

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

ITP 342 Mobile App Dev. Connections

ITP 342 Mobile App Dev. Connections ITP 342 Mobile App Dev Connections User Interface Interactions First project displayed information to the user, but there was no interaction. We want the users of our app to touch UI components such as

More information

Registering for the Apple Developer Program

Registering for the Apple Developer Program It isn t necessary to be a member of the Apple Developer Program if you don t intend to submit apps to the App Stores, or don t need the cloud-dependent features. We strongly recommend joining, though,

More information

ios Application Development Hello World App Rubric

ios Application Development Hello World App Rubric ios Application Development Hello World App Rubric 1 HelloWorld App Rubric Unsatisfactory Needs Revision Proficient Exemplary There s indication that you (student) struggle to grasp concepts. Although

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

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

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

ios 101 Hands-On Challenges

ios 101 Hands-On Challenges ios 101 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 by

More information

CSC 581: Mobile App Development Spring 2019

CSC 581: Mobile App Development Spring 2019 CSC 581: Mobile App Development Spring 2019 Unit 1: Getting Started with App Development Xcode installing XCode, creating a project, MVC pattern interface builder, storyboards, object library outlets vs.

More information

Learn to make desktop LE

Learn to make desktop LE HACKING WITH SWIFT COMPLETE TUTORIAL COURSE Learn to make desktop LE P apps with real-worldam S Swift projects REEPaul Hudson F Project 1 Storm Viewer Get started coding in Swift by making an image viewer

More information

Lesson 1: Hello ios! 1

Lesson 1: Hello ios! 1 Contents Introduction xxv Lesson 1: Hello ios! 1 ios Developer Essentials 1 A Suitable Mac 1 A Device for Testing 2 Device Differences 2 An ios Developer Account 4 The Official ios SDK 6 The Typical App

More information

ITP 342 Mobile App Dev. Table Views

ITP 342 Mobile App Dev. Table Views ITP 342 Mobile App Dev Table Views Table Views The most common mechanism used to display lists of data to the user Highly configurable objects that can be made to look practically any way you want them

More information

Topics in Mobile Computing

Topics in Mobile Computing Topics in Mobile Computing Workshop 1I - ios Fundamental Prepared by Y.H. KWOK What is ios? From Wikipedia (http://en.wikipedia.org/wiki/ios): ios is an operating system for iphone, ipad and Apple TV.

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

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

CSE 438: Mobile Application Development Lab 2: Virtual Pet App

CSE 438: Mobile Application Development Lab 2: Virtual Pet App CSE 438: Mobile Application Development Lab 2: Virtual Pet App Overview In this lab, you will create an app to take care of your very own virtual pets! The app will only have one screen and simple logic,

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

Step 1: Open Xcode and select Create a new Xcode Project from the Welcome to Xcode menu.

Step 1: Open Xcode and select Create a new Xcode Project from the Welcome to Xcode menu. In this tutorial we are going to build a simple calculator using buttons that are all linked together using the same method. We will also add our own method to the source code to create some additional

More information

COPYRIGHTED MATERIAL. 1Hello ios! A Suitable Mac. ios Developer Essentials

COPYRIGHTED MATERIAL. 1Hello ios! A Suitable Mac. ios Developer Essentials 1Hello ios! Hello and welcome to the exciting world of ios application development. ios is Apple s operating system for mobile devices; the current version as of writing this book is 5.0. It was originally

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

S A M P L E C H A P T E R

S A M P L E C H A P T E R SAMPLE CHAPTER Anyone Can Create an App by Wendy L. Wise Chapter 5 Copyright 2017 Manning Publications brief contents PART 1 YOUR VERY FIRST APP...1 1 Getting started 3 2 Building your first app 14 3 Your

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

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

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

Object-Oriented Programming in Objective-C

Object-Oriented Programming in Objective-C In order to build the powerful, complex, and attractive apps that people want today, you need more complex tools than a keyboard and an empty file. In this section, you visit some of the concepts behind

More information

Mac OS X and ios operating systems. Lab 1 Introduction to Mac OS X and ios app development. Gdańsk 2015 Tomasz Idzi

Mac OS X and ios operating systems. Lab 1 Introduction to Mac OS X and ios app development. Gdańsk 2015 Tomasz Idzi Mac OS X and ios operating systems Lab 1 Introduction to Mac OS X and ios app development Gdańsk 2015 Tomasz Idzi Introduction This lab is designed to acquaint the student with the basic functionality

More information

ITP 342 Mobile App Dev. Table Views

ITP 342 Mobile App Dev. Table Views ITP 342 Mobile App Dev Table Views Tables A table presents data as a scrolling, singlecolumn list of rows that can be divided into sections or groups. Use a table to display large or small amounts of information

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

Assignment II: Calculator Brain

Assignment II: Calculator Brain Assignment II: Calculator Brain Objective You will start this assignment by enhancing your Assignment 1 Calculator to include the changes made in lecture (i.e. CalculatorBrain, etc.). This is the last

More information

Learn to make watchosle

Learn to make watchosle HACKING WITH SWIFT COMPLETE TUTORIAL COURSE Learn to make watchosle P apps with real-worldam S Swift projects REEPaul Hudson F Project 1 NoteDictate 2 www.hackingwithswift.com Setting up In this project

More information

Index. btndrop function, 224, 226 btngetquote function, 246 btnpressed function, 28 btnquote method, 245. CallWeb method, 238, 240

Index. btndrop function, 224, 226 btngetquote function, 246 btnpressed function, 28 btnquote method, 245. CallWeb method, 238, 240 Index A App icons section icons set, 277 LaunchImage, 278 launch screen graphics, 278 279 PNG format, 277 settings, 276 App store deployment application graphics, 273 general settings Identity section,

More information

Collection Views Hands-On Challenges

Collection Views Hands-On Challenges Collection Views Hands-On Challenges Copyright 2015 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

Xcode Release Notes. Apple offers a number of resources where you can get Xcode development support:

Xcode Release Notes. Apple offers a number of resources where you can get Xcode development support: Xcode Release Notes This document contains release notes for Xcode 5 developer preview 4. It discusses new features and issues present in Xcode 5 developer preview 4 and issues resolved from earlier Xcode

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

Web 2.0 and iphone Application Development Workshop. Lab 2: iphone programming basics

Web 2.0 and iphone Application Development Workshop. Lab 2: iphone programming basics Web 2.0 and iphone Application Development Workshop This lab is prepared by: Department of Electrical and Electronic Engineering, Faculty of Engineering, The University of Hong Kong Lab 2: iphone programming

More information

CSC 581: Mobile App Development Spring 2018

CSC 581: Mobile App Development Spring 2018 CSC 581: Mobile App Development Spring 2018 Unit 2: Introduciton to the UIKit UIKit, UIViews UIControl subclasses 1 UIKit the UIKit is a code framework for building mobile apps the foundational class for

More information

Praktikum Entwicklung von Mediensystemen mit

Praktikum Entwicklung von Mediensystemen mit Praktikum Entwicklung von Mediensystemen mit Sommersemester 2013 Fabius Steinberger, Dr. Alexander De Luca Today Organization Introduction to ios programming Hello World Assignment 1 2 Organization 6 ECTS

More information

Using Advanced Interface Objects and Views

Using Advanced Interface Objects and Views HOUR 9 Using Advanced Interface Objects and Views What You ll Learn This Hour:. How to use segmented controls (a.k.a. button bars). Ways of inputting Boolean values via switches. How to include web content

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

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

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

ios Tic Tac Toe Game John Robinson at Rowan University

ios Tic Tac Toe Game John Robinson at Rowan University ios Tic Tac Toe Game John Robinson at Rowan University Agenda Day 3 Introduction to Swift and Xcode Creating the Tic Tac Toe GUI Lunch Break Writing the Tic Tac Toe Game Code RAMP Wrap up Process for Developing

More information

ITP 342 Mobile App Dev. Fundamentals

ITP 342 Mobile App Dev. Fundamentals ITP 342 Mobile App Dev Fundamentals Objective-C Classes Encapsulate data with the methods that operate on that data An object is a runtime instance of a class Contains its own in-memory copy of the instance

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

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

Building Mapping Apps for ios With Swift

Building Mapping Apps for ios With Swift Building Mapping Apps for ios With Swift Jeff Linwood This book is for sale at http://leanpub.com/buildingmappingappsforioswithswift This version was published on 2017-09-09 This is a Leanpub book. Leanpub

More information

Working with Text, Keyboards, and Buttons

Working with Text, Keyboards, and Buttons HOUR 7 Working with Text, Keyboards, and Buttons What You ll Learn in This Hour: u How to use text fields u Input and output in scrollable text views u How to enable data detectors u A way to spruce up

More information

Appeasing the Tiki Gods

Appeasing the Tiki Gods Chapter 2 Appeasing the Tiki Gods As you re probably well aware, it has become something of a tradition to call the first project in any book on programming Hello, World. We considered breaking with this

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

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

TL;DR: Interface builder is the tool within Xcode for creating a User Interface via a GUI.

TL;DR: Interface builder is the tool within Xcode for creating a User Interface via a GUI. Week 8 Lab Comp327 week 8 lab for week commencing 12 November 2018. Interface Builder TL;DR: Interface builder is the tool within Xcode for creating a User Interface via a GUI. Interface Builder has been

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

S A M P L E C H A P T E R

S A M P L E C H A P T E R SAMPLE CHAPTER Anyone Can Create an App by Wendy L. Wise Chapter 2 Copyright 2017 Manning Publications brief contents PART 1 YOUR VERY FIRST APP...1 1 Getting started 3 2 Building your first app 14 3 Your

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

Learn more about Pages, Keynote & Numbers

Learn more about Pages, Keynote & Numbers Learn more about Pages, Keynote & Numbers HCPS Instructional Technology May 2012 Adapted from Apple Help Guides CHAPTER ONE: PAGES Part 1: Get to Know Pages Opening and Creating Documents Opening a Pages

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

Chapter 2 Welcome App

Chapter 2 Welcome App 2.1 Introduction Chapter 2 Welcome App 1. A app is an app that can run on iphones, ipod touches and ipads. a. multi-purpose b. global c. unrestricted d. universal Ans: d. universal 2. You can your apps

More information

How to lay out a web page with CSS

How to lay out a web page with CSS Activity 2.6 guide How to lay out a web page with CSS You can use table design features in Adobe Dreamweaver CS4 to create a simple page layout. However, a more powerful technique is to use Cascading Style

More information

Designing iphone Applications

Designing iphone Applications Designing iphone Applications 4 Two Flavors of Mail 5 Organizing Content 6 Organizing Content 6 Organizing Content 6 Organizing Content 6 Organizing Content Focus on your user s data 6 Organizing Content

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

Types of Views. View category Purpose Examples of views. Display a particular type of content, such as an image or text.

Types of Views. View category Purpose Examples of views. Display a particular type of content, such as an image or text. ios UI Components Sisoft Technologies Pvt Ltd SRC E7, Shipra Riviera Bazar, Gyan Khand-3, Indirapuram, Ghaziabad Website: www.sisoft.in Email:info@sisoft.in Phone: +91-9999-283-283 Types of Views View

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

Assignment I: Concentration

Assignment I: Concentration Assignment I: Concentration Objective The goal of this assignment is to recreate the demonstration given in lecture and then make some small enhancements. It is important that you understand what you are

More information

ITP 342 Advanced Mobile App Dev. Core Data

ITP 342 Advanced Mobile App Dev. Core Data ITP 342 Advanced Mobile App Dev Core Data Persistent Data NSUser Defaults Typically used to save app preferences Property List (plist) in Documents Directory Data is in a dictionary or an array Coders

More information

ITP 342 Mobile App Dev. Collection View

ITP 342 Mobile App Dev. Collection View ITP 342 Mobile App Dev Collection View Collection View A collection view manages an ordered collection of items and presents them in a customizable layout. A collection view: Can contain optional views

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

App. Chapter 19 App. App (ViewController) App. Single View Application Single View Application View. (View Controller)

App. Chapter 19 App. App (ViewController) App. Single View Application Single View Application View. (View Controller) Chapter 19 App App (ViewController) App 19.1 App App Single View Application Single View Application View Controller View Controller Label Button Button (View Controller) 2 View Controller Utility Area

More information

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

Hello! ios Development

Hello! ios Development SAMPLE CHAPTER Hello! ios Development by Lou Franco Eitan Mendelowitz Chapter 1 Copyright 2013 Manning Publications Brief contents PART 1 HELLO! IPHONE 1 1 Hello! iphone 3 2 Thinking like an iphone developer

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

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

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

Xcode Release Notes. Apple offers a number of resources where you can get Xcode development support:

Xcode Release Notes. Apple offers a number of resources where you can get Xcode development support: Xcode Release Notes This document contains release notes for Xcode 5 developer preview 5. It discusses new features and issues present in Xcode 5 developer preview 5 and issues resolved from earlier Xcode

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

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

ios 9 SDK Development

ios 9 SDK Development Extracted from: ios 9 SDK Development Creating iphone and ipad Apps with Swift This PDF file contains pages extracted from ios 9 SDK Development, published by the Pragmatic Bookshelf. For more information

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

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

Table Basics. The structure of an table

Table Basics. The structure of an table TABLE -FRAMESET Table Basics A table is a grid of rows and columns that intersect to form cells. Two different types of cells exist: Table cell that contains data, is created with the A cell that

More information

Mobile Computing. Overview. What is ios? 8/26/12. CSE 40814/60814 Fall 2012

Mobile Computing. Overview. What is ios? 8/26/12. CSE 40814/60814 Fall 2012 Mobile Computing CSE 40814/60814 Fall 2012 Overview ios is the opera8ng system that runs iphones, ipod Touches, ipads, and Apple TVs. The language used to develop sogware for ios is Objec8ve- C (very similar

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

AutoCollage 2008 makes it easy to create an AutoCollage from a folder of Images. To create an AutoCollage:

AutoCollage 2008 makes it easy to create an AutoCollage from a folder of Images. To create an AutoCollage: Page 1 of 18 Using AutoCollage 2008 AutoCollage 2008 makes it easy to create an AutoCollage from a folder of Images. To create an AutoCollage: 1. Click on a folder name in the Image Browser. 2. Once at

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

Mobile Apps 2010 iphone and Android

Mobile Apps 2010 iphone and Android Mobile Apps 2010 iphone and Android March 9, 2010 Norman McEntire, Founder Servin Corporation - http://servin.com Technology Training for Technology ProfessionalsTM norman.mcentire@servin.com 1 Legal Info

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

Objective-C. Stanford CS193p Fall 2013

Objective-C. Stanford CS193p Fall 2013 New language to learn! Strict superset of C Adds syntax for classes, methods, etc. A few things to think differently about (e.g. properties, dynamic binding) Most important concept to understand today:

More information

iphone Programming Touch, Sound, and More! Norman McEntire Founder Servin Flashlight CodeTour TouchCount CodeTour

iphone Programming Touch, Sound, and More! Norman McEntire Founder Servin Flashlight CodeTour TouchCount CodeTour iphone Programming Touch, Sound, and More! Norman McEntire Founder Servin 1 Legal Info iphone is a trademark of Apple Inc. Servin is a trademark of Servin Corporation 2 Welcome Welcome! Thank you! My promise

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