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

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

 

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

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

tools you need to build an app.xcode

你是否已经想建立你本身的app?很好!建立一个app是颇有乐趣和有益的经验.可是在咱们开始iOS开发之旅app

以前,让咱们首先来看看你建立app须要的工具.ide

 

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 toui

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书写代码了,因此,准备好!

相关文章
相关标签/搜索