2016年9月15日 星期四

Xcode playground with swift (1)

#Step 1

Create project with Swift playground

#Step 2

choose platform



#Step 3

coding

#iOS

import UIKit
#OS X

import Cocoa
#Swift 1.0

var num:Int
for i in 0..<200{
var num = sin(Double(i)/10)
var num2 = cos(Double(i)/10)
var num3 = abs(Double(i)/10)
}

#Swift 2.0

var num:Int
for i in 0..200{
num = sin(Double(i)/10)
num2 = cos(Double(i)/10)
num3 = abs(Double(i)/10)
}


Share:

0 意見: