• No results found

Technology Overview Frameworks and Language(s)

In document MobileDevGuide 14th pdf (Page 72-76)

Since iOS builds on the foundation of Mac OS X, it uses a lot of the same frameworks and technologies, except for the Cocoa Touch layer (which manages and draws the user interface) and a number of other, small frameworks that are unique to either of the systems. This makes it easy for a number of applications to use a similar code base and just vary on the user interface, which would have to be completely redesigned for touch devices anyway.

Apple continues to bring the platforms closer together by making frameworks available on iOS which were previously only available on OS X and vice versa. One such example is MapKit, which Apple included in iPhone OS 3.0 in 2009 and brought to the Mac in OS X 10.9 (Mavericks) in 2013.

Most Apple supplied frameworks for iOS are written in Objective-C (or supply Objective-C APIs over a different back- end), which is a Smalltalk-inspired lightweight runtime on top of C and retains full C compatibility. Few frameworks supply C APIs, mostly those used for audio and video programming. The system also supports development in C++ and Objective-C++ and includes standard frameworks for all of those languages. Before the release of iOS, Objective-C lead a somewhat shadowy existence with ratings as low as 0.03% in the TIOBE

index7, thanks to its use almost exclusively for Apple's desktop

platform, Mac OS X. In December 2007, it was only the 57th most popular programming language and since has made its way to number three in 2013, just behind Java and C and after winning "Programming Language of the Year" in 2011 and 2012.

iOS 66

Over the past years, Apple has made numerous improvements both to the Objective-C runtime and the LLVM compiler to add new features to the language, such as automatic memory management, blocks (a form of closures) and automatically- synthesized properties, most of which directly benefits developers as they have to write less code.

On their developer website8, Apple provides a plethora of

resources for iOS developers, including software downloads, training videos, getting-started guides, documentation, sample code and forums.

Most of these resources contain very valuable information, such as the Human Interface Guidelines, which every developer should read.

Alternative Programming Languages

Coming from other platforms and languages, learning Objective- C and the iOS SDK APIs might seem very daunting, especially given the language's unusual syntax when compared with other popular programming languages. Therefore, it might be worth considering an alternative to using Apple's tools and languages.

Over the years, a number of products have popped up that add bridges or wrappers in order to support development against the iOS SDK APIs for different languages. One of the

most popular of these products is Xamarin.iOS9, previously

known as MonoTouch. The product aims to facilitate porting existing C# code bases to iOS (and Android, using Xamarin. Android), while using native iOS APIs, retaining the highest possible runtime speed. Being a commercial product, Xamarin. iOS is usually updated very quickly to support the latest changes made by Apple, which makes it a viable option for

8 developer.apple.com/devcenter/ios/ 9 xamarin.com/ios

iOS

developers interested in porting their .NET business logic to the platform.

Ruby developers interested in iOS development might take

a look at RubyMotion10, an implementation of the program-

ming language that runs on both OS X and iOS. The product offers compatibility with existing Objective-C libraries (via the

CocoaPods11 package manager or manually) and compilation of

source code (for runtime speed and obfuscation purposes). Like Xamarin.iOS, RubyMotion is a commercial product with a steady upgrade pace.

Xcode and Alternatives

For iOS (and Mac OS X) development, Apple supplies its own suite of developer tools, completely free of charge, including the following applications:

Xcode: integrated development environment

Instruments: performance analyzer running on top of DTrace

Dashcode: development environment for Dashboard widgets (Mac OS X) and other HTML-related content iOS Simulator: simulates an iOS environment for quick

testing

A commercial alternative IDE to Xcode is JetBrains' Ap-

pCode12, a Java application with various more in-depth features

than Xcode has to offer.

10 rubymotion.com

11 cocoapods.org 12 jetbrains.com/objc

iOS 68

Getting Started With iOS Development

The requirements to get started with iOS development are:

Intel-based Mac computer running Mac OS X 10.8/10.9

Free Apple Developer Connection membership

Xcode 4.x/5.x and iOS SDK (available for free from

developer.apple.com)

This setup enables you to write apps and test them in the iOS Simulator, which is included with Xcode and the iOS SDK. This is sufficient to get started and get a feel for iOS software development, but in order to actually deploy apps to iOS devices and to the App Store, a paid membership in the Apple Developer Connection is needed (available from $99 US/€79 per year). A paid membership in the iOS Developer Program also provides access to pre-release software, such as beta versions of upcoming versions of iOS and Xcode.

Generally, it is advisable to do as much testing as possible on as many different devices as possible. See the section Testing and Debugging below for more details.

For developers eager to dive into iOS app development, Apple provides many starting points and guides on its

website13. The best document to read for newcomers to the

platform is Start Developing iOS Apps Today14, which gives

a broad overview of steps and skills required to develop iOS applications and links to various in-depth articles about the entire process, from basic setup tutorials to user interaction design guidelines.

13 developer.apple.com/library/ios/navigation/#section=Resource%20

Types&topic=Getting%20Started

14 developer.apple.com/library/ios/referencelibrary/GettingStarted/

69

Diving Deeper Into iOS Development

Once you have an understanding of the basic concepts of the iOS platform, Objective-C and the Cocoa touch framework, it is time to expand your knowledge by learning about other Apple-supplied frameworks and how they can help you build outstanding iOS apps.

A great starting point to expand your knowledge is an all- encompassing book on everything about iOS development. Most experienced iOS developers will suggest one of Aaron Hillegass's

books, such as "iOS Programming: The Big Nerd Ranch Guide"15.

Even though books about iOS development tend to be outdated rather quickly, thanks to an incredibly fast development cycle, this books explains concepts that will likely be true for a while and challenges the reader more than other books usually do.

For those who learn better in a classroom environment, Big

Nerd Ranch also offers a number of training classes16 in Europe

and North America.

For even more in-depth literature, it might be worth check- ing out the current catalogs of publishers such as Pragmatic Programmers, Apress, Sams and O'Reilly. All of these regularly publish good quality books targeted at novice, intermediate and advanced levels and in-depth literature about specific frameworks.

In document MobileDevGuide 14th pdf (Page 72-76)