iOS二次发育(swift)闭包

/**
闭包关键字:
 @noescape 非逃逸闭包 默认状态。 闭包在函数结束之前被调用
 @escaping 逃逸闭包            闭包在函数结束后回调
 */
//

func block(resource: (_ content: String) -> (), with: String) {
    resource(with)
}

block(resource: { (content) in
    print(content)
}, with: "456")
原文地址:https://www.cnblogs.com/liuguan/p/7535684.html