摘要:
枚举 enum CompassPoint { case north case south case east case west } var directionToHead = CompassPoint.west directionToHead = .east 递归枚举indirect indire 阅读全文
摘要:
1.For-in循环中... for index in 1...5 { print("\(index) times 5 is \(index * 5)") } for _ in 1...5 { 可以用下划线忽略当前值 } 2.字典通过元祖返回 3.do while循环变成repeat repeat 阅读全文
摘要:
常量 变量 let age = 20 常量不可变 var num = 24 变量可变 let count:Int = 2 定义类型 Double(count) 类型转换 符号 1.?? let def = "red" var user : String? user = "hh" user ?? de 阅读全文