摘要: 枚举的基本用法 enum Direction { case north case south case east case west } enum Direction { case north, south, east, west } var dir = Direction.west dir = D 阅读全文
posted @ 2019-12-08 19:05 do+better 阅读(385) 评论(0) 推荐(0) 编辑
摘要: 函数 func pi() -> Double{ return 3.14 } func sum(v1: Int, v2: Int) -> Int { return v1 + v2 } sum(v1: 10, v2: 20) 形参默认是let,也只能是let 无返回值 func sayHello() - 阅读全文
posted @ 2019-12-08 11:16 do+better 阅读(268) 评论(0) 推荐(0) 编辑