- @escaping
Swift3,闭包参数默认为non-escaping,也可以使用@escaping属性关键字为标识闭包可 "逃逸".
Escaping and Nonescaping Closures in Swift 3
-
@Never
Swift3.0删除了@noreturn 关键字,替代方案:
<code>
/// The type of expressions that can never happen.
public /closed/ enum Never { /no values/ }
func foo() -> Never {
fatalError("no way out!")
}
</code>
It’s Now or Never…
参考
1 < https://swiftunboxed.com/lang/closures-escaping-noescape-swift3/?>