Swift3 iOS Nuke,如何使用loadImage完成活动指示器

Swift3 iOS Nuke,如何使用loadImage完成活动指示器,swift3,Swift3,我正在使用Nuke 4.1.2下载图像并将其设置为UITableView中的单元格图像 这工作正常,但没有活动指示器 if let url = URL(string: imageUrl) { Nuke.loadImage(with: url, into: cell.itemImage) } 如果我尝试这个,我会得到下面列出的错误 cell.activityIndicator.startAnimating() if let url = URL(st

我正在使用Nuke 4.1.2下载图像并将其设置为UITableView中的单元格图像

这工作正常,但没有活动指示器

if let url = URL(string: imageUrl) {                   
    Nuke.loadImage(with: url, into: cell.itemImage)
}
如果我尝试这个,我会得到下面列出的错误

cell.activityIndicator.startAnimating()

if let url = URL(string: imageUrl) {                                 
   Nuke.loadImage(with: url, into: cell.itemImage) { [weak cell.itemImage] in
   cell.itemImage.handle(response: $0, isFromMemoryCache: $1)
   cell.activityIndicator.stopAnimating()      
}
错误:

fields may only be captured by assigning to a specific name
cell.activityIndicator.startAnimating()

let cellImageView = cell.imageView

Nuke.loadImage(with: url, into: cellImageView) { [weak cellImageView] in
cellImageView?.handle(response: $0, isFromMemoryCache: $1)

cell.activityIndicator.stopAnimating()