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書寫代碼了,因此,準備好!

相關文章
相關標籤/搜索