Don't see any deprecation warning, due to "deprecated: 100000.0"? What's the rationale for marking it this way?!

I was wondering why I don't see any deprecation warning in Xcode 12 even thought I know for sure there are deprecated calls in my code. One case is:

@available(iOS, introduced: 13.0, deprecated: 100000.0, message: "Use navigationTitle(_:) with navigationBarTitleDisplayMode(_:)")
@available(OSX, unavailable)
@available(tvOS, unavailable)
@available(watchOS, unavailable)
public func navigationBarTitle(_ titleKey: LocalizedStringKey, displayMode: NavigationBarItem.TitleDisplayMode) -> some View

So it appears "deprecated: 100000.0" is why I am not seeing any warning. This mean it's deprecated in version 100000.0?!

What is the reason for marking it "deprecated: 100000.0"?

The doc shows it's deprecated: https://developer.apple.com/documentation/swiftui/view/navigationbartitle(_:)-6p1k7

Is there anyway I can force Xcode to warning me now?

I posted this same question here: https://developer.apple.com/forums/thread/653623

Apple (and the Swift project) uses available: 9999 and deprecated: 10000 to indicate availablility for future (unannounced) versions of OSes or Swift. It's likely they just haven't gotten around to properly updating the annotation for the now-announced iOS 14. You can report a bug but hopefully they have an automated checker for this stuff and the change just hasn't propagated to the betas yet.

2 Likes

deprecated: 10000 means "soft-deprecated", i.e. it's not deprecated now and will continue to function, but it's not recommended. It's the same value used in the API_TO_BE_DEPRECATED macro in availability.h.

4 Likes

Is there anyway to make Xcode show warning of these deprecated call? My Xcode 12 project deployment target is iOS 14. I want to see deprecation warning.

As of now, I don't see any warning.

1 Like

One temporary, mediocre solution I found was to open the Xcode project file (e.g. MyProject.xcodeproj/project.pbxproj) in a text editor and replace IPHONEOS_DEPLOYMENT_TARGET = 14.0; by IPHONEOS_DEPLOYMENT_TARGET = 100000.0; You'll get a lot of errors when you open the project in Xcode again (tested with Xcode 13.0) but also the deprecation warnings for the open SwiftUI files in the Xcode editor.

Terms of Service

Privacy Policy

Cookie Policy