CSCI 333 – Systems Programming

Download Report

Transcript CSCI 333 – Systems Programming

CSCI 351 – Mobile Applications
Development
Friday, August 29, 2014
Developing Apps for IOS
The Basics
 What is an app?
 App is simply short for application. It is computer software
written for a specific user task.
 What is IOS?
 Originally iPhone Operating System, IOS is a mobile operating
system developed and distributed by Apple. It was released in
2007 for the iPhone and the iPod Touch. It was later extended
for the iPad and Apple TV.
 Over 40% of smart phone subscribers use an Apple phone.
Current market share for smart phones:

https://www.comscore.com/Insights/Press-Releases/2014/3/comScore-Reports-January-2014-US-Smartphone-Subscriber-Market-Share
The Basics
 Americans used smartphone and tablet apps more than PCs to
access the Internet in January, 2014 -- the first time that has ever
happened.
 Mobile devices accounted for 55% of Internet usage in the United
States in January. Apps made up 47% of Internet traffic and 8% of
traffic came from mobile browsers. PCs clocked in at 45%.
The Basics
 What is Objective-C?
 It is a high-level, object-oriented programming language. It is the main
language used for IOS and OS X application development.
 What is Swift?
 It is a multi-paradigm, compiled programming language developed by
Apple for iOS and OS X development. Introduced in 2014, Swift is
designed to work with Apple's Cocoa and Cocoa Touch frameworks
and the large body of existing Objective-C code written for Apple
products.
 Swift is intended to be more resilient against erroneous code. It is built
with the LLVM compiler included in Xcode 6 beta, and uses the
Objective-C runtime, allowing Objective-C, Objective-C++ and
Swift code to run within a single program.
The Basics
 What is Cocoa Touch?
 It is the user interface (UI) framework for building IOS applications. It is based
on Cocoa, which is the application programming interface (API) for the Mac
operating system.
 What is Xcode?
 It is an integrated development environment (IDE) containing a suite of
software development tools developed by Apple for developing software for
OS X and iOS. First released in 2003, the latest stable release is version 5.1
and is available via the Mac App Store free of charge for Mac OS X Lion, OS X
Mountain Lion and OS X Mavericks users.
 Registered developers can download preview releases and previous versions of
the suite through the Apple Developer website. Apple recently made a beta
version of version 6.x of the software available to those of the public with
Apple Developer accounts.
Developing Mobile Apps
 More differences between developing mobile apps and
standard software
 IOS apps can read and write files in an area called a sandbox.
There is limited access to the rest of the device.
 Programs need to open quickly and close down quickly. For
example, If your app takes more than 5 seconds to give up
control when the user hits the home button, the app may be
killed.
 Conserving memory is important in writing apps. A device
(i.e., iPhone 4s, iPad 2) may have 512MB of RAM, but much of
that is used for the screen and by other system processes.
Developing Mobile Apps
 IOS devices have features that many Macs do not have:
 Determining geographic coordinates
 Built-in camera
 Built-in accelerometer
 To develop apps for IOS, you will need:
 A Macintosh computer
 Xcode software
 To register as an Apple Developer
Creating a simple “Hello World” app
1.
Create a New Xcode Project
2.
Choose IOS Application, Single View Application -> Next
3.
Enter Hello World for the Product Name
4.
Choose a location and then Create
5.
Click on Main.Storyboard, the top of the View Controller, then Attributes
(at the right). Change Size to iPhone 4-inch and Orientation as Portrait
6.
From the Object Library at the bottom right, choose and drag both a label
and a button to your View Controller
7.
Close the Utilities window and click on the Assistant Editor
Control-Drag the label to right below the line that starts Class View…
Enter theLabel as its name
Modify the line of code if needed so that it says:
@IBOutlet var theLabel: UILabel?
(Note the question mark at the end.)
1.
Control-Drag the button to below your outlet. When the popup occurs, choose
Action as the Connection type and give it a Name of theButton
2.
In the function that was created, add this line between the braces:
theLabel?.hidden = true
1.
Run your program using the simulator