Tim Langner
Tim Langner

Reputation: 417

Xcode not showing @available warnings anymore

Xcode is not giving me warnings for properties or methods that are not available on all supported iOS version by the app anymore. This is a serious problem for me and could lead to bugs or app crashes on some iOS versions.

For example, the [NSDate now] method is only available on iOS 13 and above. Using this method on an iOS 12 device would lead to a crash. The current iOS Deployment Target of my app project is set to iOS 12.0 and the app is also supported for all versions above iOS 12. But for some reason I don't get a warning anymore if I use a method or property which is not available on iOS 12 and only on the version above.

I'm using Xcode 12.5. I also tried using Xcode 12.4 and the Xcode 13 Beta but it's the same. Is this a problem with the project?

Upvotes: 1

Views: 483

Answers (1)

Larme
Larme

Reputation: 26086

Go to Build Settings, you can search for Unguarded availability on the search bar, or find it in Apple Clang - Warnings - All Languages section.

Set the value to Yes

Upvotes: 3

Related Questions