shaps80 / SwiftUIBackports

A collection of SwiftUI backports for iOS, macOS, tvOS and watchOS
MIT License
931 stars 59 forks source link

Xcode 14.3 beta 2 fails to build SwiftUIBackports - iOS 14 API used #42

Closed rhysm94 closed 1 year ago

rhysm94 commented 1 year ago

Have you read the Contributing Guidelines?

General Information

Describe the bug

When attempting to build a project which imports SwiftUIBackports in Xcode 14.3 beta 2, the compiler fails on the file Toolbar.swift with the error Namespace is only available in iOS 14.0 or newer. The same error doesn't happen in Xcode 14.2, but I'm not sure why that is. Accessing the same Toolbar.swift file and Cmd+right clicking the Namespace property wrapper shows that it was introduced in iOS 14, and the file shouldn't have been successfully building while the package targets iOS 13+.

Steps to reproduce

Add SwiftUIBackports as a dependency to a project targeting any version of iOS with SwiftUI, and attempt to build in Xcode 14.3 beta 2.

Expected behavior

SwiftUIBackports to build correctly

Screenshots

If applicable, add screenshots, gifs, or videos to help explain your problem.

image image

Additional context

In the generated header for Namespace, it's attributed like this:

@available(iOS 14.0, macOS 11.0, tvOS 14.0, watchOS 7.0, *)
@frozen @propertyWrapper public struct Namespace : DynamicProperty {

So I'm really confused as to how it built/worked before 😅

shaps80 commented 1 year ago

Great point! That shouldn't be there actually! Wow, no idea what's happened here. Thank you!

rhysm94 commented 1 year ago

Closed with #44

shaps80 commented 1 year ago

Thanks for fixing @rhysm94 – Now available in v1.15.1

rhysm94 commented 1 year ago

No problem @shaps80, glad to help!