【发布时间】:2016-01-12 19:31:56
【问题描述】:
我正在使用 url 加载图像,但想在加载图像时显示加载图标。我发现这个方法签名有一个我想使用但不知道如何使用 completionHandler 的 completionHandler。
UIImageView.load( URL: URLLiteralConvertible, placeholder: UIImage?, completionHandler (NSURL, UIImage?, NSError?, CacheType) -> ())
有人知道怎么称呼吗?谢谢!
我目前所拥有的
let imgUrl = NSURL(string: imgURL)
self.img.load(imgUrl!, placeholder: UIImage(named: "greySq.png"), completionHandler: { _ in
} //Throws a syntax error
【问题讨论】:
标签: swift uiimageview completionhandler