swift3.0属性block

前端之家收集整理的这篇文章主要介绍了swift3.0属性block前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
//定义
    typealias funcBlock = (_ result : Bool) -> ()
    var blockProperty : funcBlock?

    //使用
    vc.blockProperty = { [unowned self]
            (param) -> () in
            let vc = DCAlbumViewController()
            self.navigationController?.pushViewController(vc,animated: false)
        }
原文链接:https://www.f2er.com/swift/322610.html

猜你在找的Swift相关文章