1 赋值运算符(Assignment Operator)
赋值操作并不返回任何值1
2
3let b = 10
var c = 5
let (x, y) = (2, 5)
2 算术运算符(Arithmetic Operators)
1 | 1 + 2 |
3 复合赋值(Compound Assignment Operators)
复合赋值运算没有返回值
1 | var a = 1 |
4 比较运算符(Comparsion Operators)
1 | 1 == 1 |
5 三目运算符(Ternary Conditional Operator)
1 | true ? "true" : "false" |
6 空合运算符(Nil Coalescing Operator)
1 | var e: String? |
7 区间运算符(Range Operators)
1 | for index in 1...5 { |
8 逻辑运算(Logical Operators) 操作对象是逻辑布尔值
1 | var mybool = false |
playground文件在andyRon/LearnSwift