Last update : September 10, 2015
iOS is the operating system that runs on iPad, iPhone and iPod devices. The operating system manages the device hardware and provides the technologies required to implement native apps.
The iOS architecture is layered in four levels :
- Cocoa Touch (at the top level)
- Core services
- Core OS (at the bottom level)
At the highest level, iOS acts as an intermediate between the underlying hardware and the apps.
To develop applications for iOS devices the following tools are required :
- Mac computer running OS X 10.9.4 or later
- iOS SDK
- Apple Developer Program
Xcode is an integrated development environment (IDE) created by Apple for developing software for OS X and iOS devices. First released in 2003, the latest stable release is version 6.4 and is available via the Mac App Store free of charge for OS X Yosemite users. Xcode 7 is available as beta version. Xcode is installed into the /Applications directory.
Xcode is used in two ways. It is not only the name for the suite of developer tools, but also the name of an application within that suite : an Xcode project.
The program code to develop an iOS App is embedded in an Xcode project which is saved itself in an Xcode workspace. A workspace is a container that encompasses multiple projects that share common resources.
The result of the development process is called product, specified by an Xcode target. Projects can contain one or more targets, each of which produces one product. Usually there are 2 targets : a release version and tests. The targets can also be a plain and light version of an app for the Apple Store.
An Xcode scheme defines a collection of targets to build, a configuration to use when building, and a collection of tests to execute. Introduced with Xcode 4, schemes are a powerful way to control how you build, debug, test, analyze, profile, and deploy your application. You can have as many schemes as you want, but only one can be active at a time. Xcode uses build settings to specify aspects of the build process followed to generate a product. A build setting is a variable that determines how build tasks are performed.
Another concept of Xcode are templates. Xcode includes the following built-in app templates for developing common types of iOS apps, such as games, with preconfigured interface and source code files :
- Single View Application
- Master-Detail Application
- Page-Based Application
- Tabbed Application
- Cocoa Touch Framework
- Cocoa Touch Static Library
- In-App Purchase
Since Snow Leopard (Xcode 3.2), Xcode uses the LLVM compiler, based on the open source LLVM.org project. The LLVM compiler uses the Clang front end to parse source code and turn it into an interim format.
Xcode supports the following program files :
- xxx.h : headers (interfaces)
- xxx.m : Objective-C implementations
- xxx.mm : Objective-C++ implementations
- xxx.swift : Swift implementations
- xxx.c : C implementations
- xxx.cpp : C++ implementations
The developed app can be tested on a real iOS device or in the iOS simulator integrated in Xcode.
The iOS SDK is a software development kit developed by Apple and released in February 2008 to develop native applications for iOS devices. The initial name was iPhone SDK.
The main features of the iOS SDK are :
- Cocoa Touch
Apple Developer Program
To get everything you need to develop and distribute your iOS apps, you must enroll in an Apple Developer Program. The iOS Developer Program costs 99$ per year. After registration, payment and acceptance by Apple, I did my first login to the Apple Developer Member Center with my Apple ID on April 24, 2015.
iOS Apps must be signed by the developer to deploy them on an iOS device. To test a signed app on a real device, you must registrate this device. You can registrate up to 100 iOS devices in your development account. The devices must be connected to the Mac computer running Xcode to test and install an app.
To register an iOS device for development, you must know its UDID (Unique Device Identifier). There are several possibilities to get this UDID when the device is connected to the Mac Computer :
- with iTunes running on a Mac
- with the Mac USB Inspector
- with Xcode running on a Mac
Without connection an iOS device to a Mac computer, it’s possible to access the webpage get.udid.io to reveal it.
I registrated my iPhone 5 and my iPad 2 in my iOS development account.
After reviewing and confirming the informations, the registration was complete.
The iOS Developer Library is the most important documentation resource to help developers. The library contains API references, programming guides, release notes, technical notes, sample code and other documents.
The tutorial Start Developing iOS Apps Today is he perfect starting point for creating apps that run on iPad, iPhone, and iPod touch.
Cocoa and Cocoa Touch
Cocoa is Apple’s native object-oriented application programming interface (API) for the OS X operating system. Cocoa Touch is the API for iOS. Cocoa and Cocoa Touch follows a Model-View-Controller (MVC) software architecture.
Objective-C is a general-purpose, object-oriented programming language that adds Smalltalk-style messaging to the C programming language. It is the main programming language used by Apple for the OS X and iOS operating systems. Objective-C was originally developed in the early 1980s. It was selected as the main language used by NeXT for its NeXTSTEP operating system, from which OS X and iOS are derived.
Swift is a multi-paradigm, compiled programming language launched by Apple in 2014 for iOS and OS X development. Swift is intended to be more resilient to erroneous code than Objective-C, and also more concise. It uses the Objective-C runtime, allowing C, Objective-C, C++ and Swift code to run within a single program.
The system interfaces to the iOS Technologies are delivered by Apple in the iOS SDK in special packages called Frameworks. These are directories that contain shared libraries and the resources needed to support that library. The main iOS Frameworks provided are the following :
- AV Foundation
- Game Kit
- Game Controllers
- Core Data
- Core Graphics
- Sprite Kit
- Core Animation
- OpenGL ES
Additional useful informations about iOS development are provided at the websites referenced hereafter :
- How to deploy your App on an iPhone, by CodeWithChris
- How to create an Empty Application in Xcode 6 without Storyboard, StackOverflow
- iOS Tutorial: How To Create A Simple iPhone App (3 parts), by Ray Wenderlich
- Background Modes Tutorial: Getting Started, by Ray Fix
- How to Create a Framework for iOS, by Sam Davies
- Universal Framework for iOS, by Diney Bomfim
- Storyboards Segue Tutorial: Pass Data Between View Controllers, by Simon (AppCoda)
- Scene Kit Tutorial: Getting Started, by Ricardo Rendon Cepeda
- Setting Up Your Workspace in Xcode, by Maurice Kelly and Joshua Nozzi