99热99这里只有精品6国产,亚洲中文字幕在线天天更新,在线观看亚洲精品国产福利片 ,久久久久综合网

歡迎加入QQ討論群258996829
Swift 頭像
蘋(píng)果5袋
5
Swift

Swift 學(xué)習(xí)筆記一:開(kāi)始寫(xiě)第一個(gè)Swift程序

發(fā)布時(shí)間:2014-09-03 23:31  回復(fù):1  查看:5857   最后回復(fù):2014-09-04 23:48  

本人買(mǎi)了一臺(tái)mac book pro專(zhuān)門(mén)學(xué)習(xí)Swift,以后會(huì)寫(xiě)一些學(xué)習(xí)筆記發(fā)上來(lái)。學(xué)習(xí)資料主要蘋(píng)果官方發(fā)布的《The Swift Programming Language》,通過(guò)iBook可以找到。

今天學(xué)習(xí)了如何開(kāi)始寫(xiě)第一個(gè)Swif程序。

首先下載安裝Xcode 6,我目前用的是Xocde 6 beta 6。


打開(kāi)Xcode,F(xiàn)ile -> New -> Playground創(chuàng)建一個(gè)playground,如下圖:

輸入文件名



圖1:輸入文件名

選擇保存路徑



圖2:選擇保存路徑

保存好后出現(xiàn)如下窗口:

Swift編輯窗口



上圖中,左邊是代碼編輯區(qū)域,右邊是實(shí)時(shí)顯示代碼效果的區(qū)域。在左邊每敲一行代碼,右邊都會(huì)實(shí)時(shí)顯示出來(lái),不用編譯也不用運(yùn)行。真是很強(qiáng)大。這時(shí)就可以開(kāi)始Swift之旅了。


Swift 頭像
蘋(píng)果5袋
5
Swift   2014-09-04 23:48

這里對(duì)Playground進(jìn)行下介紹,Playground是用于快速開(kāi)發(fā)和調(diào)試的,開(kāi)發(fā)好后要把這些代碼要移到項(xiàng)目中。當(dāng)然也可以用來(lái)學(xué)習(xí)Swift。下面這段是蘋(píng)果網(wǎng)站對(duì)Playground的介紹。

Playgrounds enable the interactive experience of a script language, even though Swift compiles to highly-optimized native code. Type a line of code and the result appears immediately. If your code runs through a loop, add that line of code to the timeline assistant editor to watch its progression. Display variables in a graph, inspect each step when drawing a view, or watch an animated SpriteKit scene. When you’ve perfected your code in the playground, simply move it into your project. Playgrounds documentation includes tutorials that you can open in a playground, providing an interactive worksheet for experimentation.

您還未登錄,請(qǐng)先登錄

熱門(mén)帖子

最新帖子

?