'init(content:)' is only available in iOS 18.0 or newer

Everything was working fine until I updated MacOS.

Now, I'm getting the error:

'init(content:)' is only available in iOS 18.0 or newer

when simply using TabView & Tab in SwiftUI, which are definitely supported prior to iOS 18. Screenshot attached.

Can someone tell me what the heck is going on?

I misspoke: Tab is not supported prior to iOS 18, which is super confusing, because in the documentation for TabView, literally all of the code examples are using Tab within TabView, and TabView is supported by iOS 13, but Tab isn't.

On top of that, when trying to use .tabItem, I'm being prompted to NOT use it, but use Tab instead, because tabItem will be deprecated, but that's kinda ******** if I'm targeting anything older than iOS 18. So what am I missing?

TabView(content:) and TabView(selection:content:) API are supported starting from iOS 18.0, iPadOS 18.0, Mac Catalyst 18.0, macOS 15.0, tvOS 18.0, and visionOS 2.0. While tabItem(_:) API, now deprecated, is supported on iOS and iPadOS versions 13.0 through 18.1.

Please refer to the API documentation.

I appreciate the attempt to clarify, and I'll take a look at those link, but I'm talking about using TabView as demonstrated in the docs found here:

https://developer.apple.com/documentation/swiftui/tabview

TabView doesn't even seem to be the problem. Tab is the problem, actually. I've been able to use .tabItem, in the meantime, which is not yet deprecated, according to xcode, but will be.

'init(content:)' is only available in iOS 18.0 or newer
 
 
Q