Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deprecating renamed method with multiple arguments

I wanted to update the naming of the following method for Swift 3:

public func imageWithUrl(url: String, placeholderNamed: String) {
    if let image = UIImage(named: placeholderNamed) {
        imageWithUrl(url: url, placeholder: image)
    } else {
        imageWithUrl(url: url)
    }
}

to

public func image(url: String, placeholderNamed: String) {

So I deprecated the old method with this:

@available(*, deprecated: 1.8, renamed: "image(url:, placeholder:")

The problem is that I'm getting the following error:

'renamed' argument of 'available' attribute must be an operator, identifier, or full function name, optionally prexied by a type name

like image 548
Lucas Farah Avatar asked Dec 13 '16 08:12

Lucas Farah


1 Answers

I was having a problem with the renamed: part. In order to fix that, just change it to

@available(*, deprecated: 1.8, renamed: "image(url:placeholder:)")
like image 104
Lucas Farah Avatar answered Nov 08 '22 21:11

Lucas Farah