Saturday, 26 April 2014

Installing Xcode [Got Tools]

Apple has made installing Xcode as easy as possible. On your Mac, launch the App Store application and search for Xcode, as shown in Figure 1-1.


Figure 1-1. Xcode in the App Store

Click the install button to start downloading Xcode. This will take a while (see Figure 1-2). You can monitor its progress from the Purchases tab of the App Store. Be patient. Xcode is huge and, even with a fast Internetconnection, it will take some time to download.


Figure 1-2. Downloading Xcode

While Xcode is downloading, lets talk about it and some related topics.

What is Xcode?

So what is this huge application you’re downloading?

Xcode is an Integrated Development Environment (IDE). Modern software development requires dizzying number of different programs. To build and test an iOS app you’re going to need editorscompilers, linkers, syntax checkers,cryptographic signers, resource compilers, debuggers, simulatorsperformance analyzers, and more. But you dont have to worry about that; Xcode orchestrates all of those individual tools for you. All you have to do is use the Xcodeinterfacto design your app, anXcode will decide what tools need to be run, and when. In other words, Xcode puts the “I in IDE.

As well as including all of the tools you’ll need, Xcode can host a number of Software Development Kits (SDKs). An SDK is a collection of files that supply Xcode with what it needs to build an app for a particular operatingsystem, like iOS 7. Xcode downloads with an SDK to build iOS apps and an SDK to build OS X apps, for the most recent versions of each. Yocan download additional SDKs as needed.
An SDK will consist of one or more frameworks. A framework tells Xcode exactly how your application can use an iOS service. This is called an Application Programming Interface (API). While its possible to write code in your app to do just about anything, much of what it will be doing is making requests to iOS to do things that have already been written for you: display an alert, look up a word in the dictionary, take a picture, play a song, and so on.Most of this book will be showing you how to request those built-in services.

Wow, thats a lot of acronyms! Lets review them:

n     IDE: Integrated Development Environment. Xcode is an IDE.

n     SDK: Software Development Kit. The supporting files that let you build an app for a particular operating system, like iOS 7.

n     API: Application Programming Interface. A published set of functions, classes, and definitions that describe how your app can use a particular service.

You dont need to memorize these. Its just good to know what they mean when you hear them, or talk to other programmers.

Becoming an iOS Developer

The fact that you’re reading this book makes you an iOS developer—at least in spirit. To become an official iOS developer, you need to join Apples iOS Developer program.

You must be an iOS Developer if you want to do any of the following:

n     Sell, or give away, your apps through Apples App Store.

n     Gain access to Apples Developer Forums and other resources.

n     Give your apps to people directly (outside of the App Store).

n     Develop apps that use Game Kit, in-app purchases, push notifications, or similar technologies.

n     Test your apps on a real iOS device.

The first reason is the one that prompts most developers to join the program, and is probably the reason you’ll join. You dont, however, have to join to build, test, and run your apps in Xcodes simulator. If you never plan todistribute your apps through the App Store, or run your app on an iOS device, you may never need to become an iOS Developer. You can get through most of this book without joining.

Another reason for joining is to gain access to the iOS Developers community and support programs. Apples online forums contain a treasure trove of information. If you run into a problem and cant find the answer, theres agood chance someone else has already bumped into the same problem. A quick search of the Developer Forums will probably reveal an answer. If not, post your question and someone might have an answer for you.

Even if you dont plan to sell or give away your masterpiece on the App Store, there are a couple of other reasons to join. If you want to install your app on a device, Apple requires that you become registered developer. Applewill then generate special files that will permit your app to be installed on an iOS device.

As a registered developer, Apple will also allow you to install your apps on someone elses device directly (i.e., not through the App Store). This is called ad-hoc distribution. There are limits on the number of people you cando this for, but it is possible.
Finally, some technologies require your app to communicate with Apples servers. Before this is allowed, you must register yourself and your app with Apple, even just to test them. For example,
if you plan to use Game Kit in your app—and this book includes a Game Kit example—you’ll need to be an iOS Developer.

Bookmark this URL: http://developer.apple.com/

As I write this book, the cost of becoming an iOS Developer is $99(US). Its an annual subscription,
so theres no point in joining until you need to. Follow that link to find more information about Apples developer programs.

So is there anything at developer.apple.com thats free? Theres quite a lot, actually. You can search through all of Apples published documentation, download example projects, read technology guides, technical notes, and more—none of which require you to be an iOS Developer. Some activities require you to log in with your AppleID (your iTunes or iCloud account will work), or you can create a new AppleID.

Paid registration also gives you the opportunity to buy tickets to the World Wide Developers Conference (WWDC) held by Apple each year. Its a huge gathering, and its just for Apple developers.

Getting the Projects

Now would be a good time to download the project files for this book. There are numerous projects used throughout this book. Many can be recreated by following the steps in each chapter, and I encourage you to do thatwhenever possible so you’ll get a feel for building your apps from scratch. There are, however, a number of projects that dont explain every detail, and some projects include binary resources (image and sound files) that cant bereproduced in print.

Go to this books page at http://www.apress.com (you can search for it by name, ISBN, or the authorname). Below the books description, you’ll see some folder tabs, one of which is labeled SourcCode/Downloads. Click that tab.Now find the link that downloads the projects for this book. Click that link and a file named Lear iOS Developmen Projects.zip will download to your hard drive.

Locate the file Learn  iOS Development  Projects.zip in your Downloads folder (or wherever your browser saved it). Double-click the file to extract its contents, leaving you with a folder named Learn  iOS Development  Projects. Move the folder wherever you like.

No comments:

Post a Comment