我想更新Swift 3的以下方法的命名:
public func imageWithUrl(url: String, placeholderNamed: String) {
if let image = UIImage(named: placeholderNamed) {
imageWithUrl(url: url, placeholder: image)
} else {
imageWithUrl(url: url)
}
}
到
public func image(url: String, placeholderNamed: String) {
所以我用这个来弃用旧方法:
@available(*, deprecated: 1.8, renamed: "image(url:, placeholder:")
问题是我收到以下错误:
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
答案 0 :(得分:8)
我遇到了renamed:
部分的问题。为了解决这个问题,只需将其更改为
@available(*, deprecated: 1.8, renamed: "image(url:placeholder:)")