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

歡迎加入QQ討論群258996829
Swift 頭像
蘋果5袋
5
Swift

Swift 學(xué)習(xí)筆記一:開始寫第一個Swift程序

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

本人買了一臺mac book pro專門學(xué)習(xí)Swift,以后會寫一些學(xué)習(xí)筆記發(fā)上來。學(xué)習(xí)資料主要蘋果官方發(fā)布的《The Swift Programming Language》,通過iBook可以找到。

今天學(xué)習(xí)了如何開始寫第一個Swif程序。

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


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

輸入文件名



圖1:輸入文件名

選擇保存路徑



圖2:選擇保存路徑

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

Swift編輯窗口



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


Swift 頭像
蘋果5袋
5
Swift   2014-09-04 23:48

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

您還未登錄,請先登錄

熱門帖子

最新帖子

?