*1线婚,swift中導(dǎo)入框架
import UIKit
- 2狼电,定于你標識符
let count: Int = 10
var name: String = "zhangdanfeng"
- 3蜒灰,打印
print("zhangdanfeng")
- 4弦蹂,常量和變量(優(yōu)先使用常量,常量不可以修改强窖,但是可以通過指針獲取內(nèi)部對象凸椿,修改內(nèi)部對象的屬性)
let view: UIView = UIView()
view.backgroundColor = UIColor.red
view.frame = CGRect(x: 0, y: 0, width: 100, height: 100)
//view = UIView()//錯誤寫法,因為是常量不可以修改
var view01: UIView = UIView()
view01 = UIView()