The beginning iOS8 Programming with Swift 中文翻译 - 3

Getting Started with Xcode 6   Development   从Xcode6开始开发

 

So you want to create your own app? That’s great! Creating an app is a fun and rewarding

experience. But before we begin to dive into iOS programming, let’s first go through the

tools you need to build an app.

你是否已经想创建你自己的app?很好!创建一个app是很有乐趣和有益的经验.但是在我们开始iOS开发之旅

之前,让我们首先来看看你创建app需要的工具.

 

1. Get a Mac   拥有一台mac

Yes, you need a Mac. It’s the basic requirement for iOS development. To develop an

iPhone (or iPad) app, you need to first get a Mac with Intel-based processor running on

Mac OS X version 10.9.4 (or up). Probably you still own a PC, the cheapest option is to

purchase the Mac Mini. As of this writing, the retail price of the entry model is US$599.

You can hook it up with the monitor of your PC. The basic model of Mac mini comes with

2.5GHz dual-core Intel Core i5 processor and 4GB memory. It should be well enough to

run the iOS development tool smoothly. Of course, if you have more budget, get the higher

model or iMac with better processing power.

是的,你需要一台mac,这是iOS开发的基本环境.为了开发一个iPhone或者iPad程序,你必须先搞来一台基于

Intel CPU平台的系统版本在10.9.4及以上的苹果电脑,最便宜的方法是去购买一台Mac mini,截至本文编写的

日子,价格为500美元,你可以把他和你的个人电脑的显示器链接在一起,最低配的Mac mini的配置为I5处理器

主频为2.5GHz以及4GB的内存,这个配置已经可以流畅的运行iOS开发工具了,当然,如果你有更多的预算,

购买一台更高配的或者一台iMac不失为一个好的选择.

 

2. Register as an Apple Developer  注册成为一个苹果开发者

Don’t mix this up with the paid iOS Developer Program that we’re going to talk about in a

later section. Anyone can register as an Apple developer for free. By registering a

developer account, you’re allowed to download Xcode, access documentation of the iOS

SDK and other technical resources such as development videos.

You can go to Apple’s developer website (https://developer.apple.com/programs/register/)

for registration. The registration process is very straightforward. Simply create an Apple ID

(if you don’t have one already) and fill in your personal profile.

千万不要与购买苹果开发者计划搞混淆了,那个是在下一章进行讲解的.每个人注册成为苹果开发者都是免费的.

注册一个开发者账户,你才会被允许下载Xcode,才可以查阅iOS SDK的文档及观看诸如开发者视频等等的教学资源.

你可以通过访问访问https://developer.apple.com/programs/register/网页完成注册.这个注册的过程是非常

简单的.直接创建一个Apple ID(如果你没有的话)并且把他填入到你的个人资料中.

 

3. Install Xcode  安装Xcode

To start developing iOS apps, Xcode is the only tool you need to download. Xcode is

an integrated development environment (IDE) provided by Apple. Xcode provides

everything you need to kick start your app development. It already bundles the latest

version of iOS SDK (short for Software Development Kit), a built-in source code

editor, graphic user interface (UI) editor, debugging tools and many more. Most

importantly, Xcode comes with an iPhone (and iPad) simulator so you can test your

app without the real devices.

To download Xcode, launch Mac App Store on your Mac. If you’re using the latest

version of Mac OS, you should be able to open the Mac App Store by clicking the

icon in the dock. In case you can’t find it, you may need to upgrade your Mac OS.

如果想开始编写iOS app,Xcode是唯一需要下载的工具,Xcode是苹果给予的一款综合开发工具,

他通常与最后一个版本的iOS SDK进行捆绑,里面内置了源代码编辑,图片工具编辑以及调试工具等等.

最重要的是Xcode里有iPhone和iPad的模拟器,所以你可以在没有真机的情况下进行调试.

你可以通过打开你苹果电脑上的苹果商店下载Xcode.如果你使用的是最新版本的苹果系统,你可以

通过点击dock上的图片去打开苹果商店,如果你发现找不到他,你可能需要更新你的系统.

 

In the Mac App Store, simply search “Xcode” and click “Free” button to

download it. Once you complete the  installation process, you will find the

Xcode folder in the Launchpad. At the time of this writing, the latest

version of Xcode is 6.1. Throughout this book, we will use this version of

Xcode to create the demo apps. Even if you have installed Xcode before,

I suggest you upgrade to the latest version. This should make it easier

for you to follow the tutorials.

在Mac的苹果商店,简单的搜索Xcode并且点击免费按钮去下载它,等待安装的进度条

完毕,你可以发现在Lauchpad中看到xcode图标.截至下笔日,最新的xcode版本为6.1

所以本书就以此版本的Xcode去创建app 实例.如果你之前安装过Xcode,我提议你升级

到最新版本,这样有利于你跟上我们的教程.

 

4. Enroll in iOS Developer Program (Optional) 加入开发者计划 (可选)

A common question about developing an  iOS app is whether you need to enroll in

the iOS Developer Program (https://developer.apple.com/programs/ios/). The

short answer is optional. As mentioned earlier, Xcode already includes a built-in

iPhone and iPad simulator. You can develop and test out your app on your

Mac, without enrolling in the program.

你可能会有一个疑问:开发一个iOS App是否需要你假如到iOS开发者计划

(https://developer.apple.com/programs/ios/),最简短的回答是:随你便

就像之前说的,Xcode已经内置了iPhone和iPad的模拟器,你可以在不加入开发者计划的情况下

在你 的Mac电脑上开发并且测试你的app.

The simulator is the only way to test your apps. You can’t deploy and run the app on your

iPhone or iPad. On top of that, you’re not able to submit your app to App Store.

Though the simulator is powerful, it doesn’t simulate all features of an iPhone. For

instance, it doesn’t come with the camera or video capture feature. If you’re building a

camera app, the only way is to test the function on a real iOS device. In this case, you

have to join the iOS Developer Program!

So, should you enroll in the program now? The iOS Developer Program costs US$99 per

year. It’s some big money but it’s not cheap either. As you’re reading this book, you’re

probably a new comer and just start exploring iOS development. My suggestion is to first

use the simulator for testing your app. The book is written with that in mind. So you just

need Xcode 6 and use the simulator to go through most of the exercises.

That’s all for the introduction. Take some time to register your developer account and

install Xcode 6. When we move onto the next chapter, we will start programming in Swift.

So get ready!

模拟器是你唯一的方式测试你的app,你不能在你的iPhone或者iPad中部署或者运行你的程序而且你不能

上传你的app到苹果商店.

尽管,模拟器是非常强大的,但是它不能模拟iPhone的所有特性.例如,他不能为你模拟照相机和摄像机的

特性.如果你正在开发一个照相机的app,唯一进行测试的方法是在一个真实机上.基于这个情况,你就必须

加入苹果开发者计划了.所以,现在是否就需要加入开发者计划呢?开发者计划购买每年需要99美元.这钱

不是一个很小的数目,你现在正在读这本书,你可能是一个新加入的开发者并且才开始探索iOS开发的奥妙.

我的建议是:你先用模拟器来测试你的app,这本书就是因为这个目标才写的,所以你只需要用Xcode 6 和模拟器

就可以应付大部分的练习.

这就是所有的介绍.花费一些时间去注册你的开发者账号并且安装Xcode6,当你翻到下一章,我们就开始

用swift书写代码了,所以,准备好!

posted @ 2015-12-03 19:13  CJDanger  阅读(198)  评论(0编辑  收藏  举报