Double question mark is a nil-coalescing operator . In plain terms, it is just a shorthand for saying != nil . First it checks if the the return value is nil, if it is indeed nil, then the left value is presented, and if it is nil then the right value is presented.
Read moreWhat are optionals in Swift?
An Optional is a type on its own, actually one of Swift 4’s new super-powered enums . It has two possible values, None and Some(T), where T is an associated value of the correct data type available in Swift 4.
Read moreWhat is overflow Swift?
Overflow Operators. If you try to insert a number into an integer constant or variable that can’t hold that value, by default Swift reports an error rather than allowing an invalid value to be created. This behavior gives extra safety when you work with numbers that are too large or too small.
Read moreWhat does += mean in Swift?
The expression a += 2 is shorthand for a = a + 2 . Effectively, the addition and the assignment are combined into one operator that performs both tasks at the same time . Note. The compound assignment operators don’t return a value. For example, you can’t write let b = a += 2 .
Read more