8

I have this snippet code :

@available(*, deprecated:3.0, message:"Use activate().") public func install() { self.activate() } 

And since i've upgraded to swift5 and xcode 10.2 i get below warning :

Unexpected version number in 'available' attribute for non-specific platform '*'

And fixed with :

Replace ':3.0' with ''

What is this warning? what does it say?

1
  • 2
    I actually experienced the same thing when I was migrating to Swift 5. But such kind of warning went away after completely updating what needs to be updated, clean, and build. Commented Apr 17, 2019 at 6:43

1 Answer 1

12

The documentation states that the asterisk cannot be used with Swift version numbers, but perhaps this wasn't enforced before Swift 5?

The equivalent attribute would be:

@available(swift, deprecated:3.0, message:"Use activate().") 

Even better would be:

@available(swift, deprecated:3.0, renamed:"activate()") 
Sign up to request clarification or add additional context in comments.

1 Comment

In my case, this is inside a 3rd party library, and I cannot update the source code for this library as it is no longer maintained.. Is there a workaround where by such enforcement that * cannot be used, can be given an exception?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.