Void"在没有更多上下文的情况下不明确-6ren"> Void"在没有更多上下文的情况下不明确-请在下面的代码中帮助我。我收到一个错误: Expression type "(_, _) -> Void" is ambiguous without more context. import UIKi-6ren">
gpt4 book ai didi

swift - 表达式类型 "(_, _) -> Void"在没有更多上下文的情况下不明确

转载 作者:行者123 更新时间:2023-11-28 15:27:30 27 4
gpt4 key购买 nike

请在下面的代码中帮助我。我收到一个错误:

Expression type "(_, _) -> Void" is ambiguous without more context.

import UIKit
import SDWebImage

class CustomImageView: UIImageView {
let progressIndicatorView = CircularLoaderView(frame: CGRect.zero)

required init(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)!

addSubview(self.progressIndicatorView)
progressIndicatorView.frame = bounds
progressIndicatorView.autoresizingMask = [.flexibleWidth, .flexibleHeight]

let url = NSURL(string: "http://png-3.findicons.com/files/icons/2795/office_2013_hd/2000/word.png")
self.sd_setImage(with: url as URL?, placeholderImage: nil, options: .cacheMemoryOnly, progress: { [weak self] (receivedSize, expectedSize) -> Void in
self.progressIndicatorView.progress = CGFloat(receivedSize)/CGFloat(expectedSize)
}) { [weak self](image, error, _, _) -> Void in
self.progressIndicatorView.reveal()
}
}
}

最佳答案

NSURL 更改为 URL 应该可行!

关于swift - 表达式类型 "(_, _) -> Void"在没有更多上下文的情况下不明确,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45043201/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com