Closed rizwan95 closed 2 years ago
Seems like a bug in Swift 5.5
I'll keep an eye on this. Hopefully, they'll fix the bug!
@wtmoose @dneykov There is no activity in the bug report after it was reported or am I missing anything??
Hi, do you have any hopes for the bug to be fixed by apple before iOS 15 release? the bug SR-14539 is marked as "Improvement" and without any activity for a long time...
@racsol I have no idea
My intuition says that Apple won't fix the bug sooner. What do we do?
I temporarily downloaded the source. And set Platform in Package.swift
platforms: [ .iOS ("13.0") ],
And added it as a Local Package. After that, no error occurred.
This is a temporary method.
I temporarily downloaded the source. And set Platform in Package.swift
platforms: [ .iOS ("13.0") ],
And added it as a Local Package. After that, no error occurred.
This is a temporary method.
Yes that is one hackish solution...
Asked the author of that change about it: https://twitter.com/slava_pestov/status/1409910935347732489?s=20
In short, the code needs to be updated not to require @available
edit: deleted brainfart
LOL...I'm not sure his suggestion would qualify as a workaround.
@eigenl It seems you're trying to suggest a compile-time check but available
is a run time thing. The code you're written if #available...#else
isn't valid syntax and wouldn't compile.
If they're actually not going to fix this, then the only options I see are (a) make a breaking API change in SwiftUI or (b) stop supporting iOS 12 and below.
I'm inclined to take option (b).
Yeah, sorry for the brainfart. Removed it. Another passable solution would be
case windowScene(_: Any, windowLevel: UIWindow.Level)
and casting the associated value to UIWindowScene where needed (just one location in SwiftMessages.Config+Extensions.swift
).
This does remove compile-time guarantee but requires no changes to applications and is the smallest change that could be made to fix it I believe. Dropping iOS 12 is certainly an option, but poses a problem for application developers where decisions regarding minimum targets are out of their hands.
I suppose the solution proposed by @eigenl should be good enough. What are your thoughts @wtmoose ? We need to act quick or else there will be many projects breaking due to this issue
I reported the same issue in https://bugs.swift.org/browse/SR-14878 and that was just closed as "works as designed". Bummer.
Any plans on fixing this issue? It seems that this will not be fixed in the swift project....
Yeah, sorry for the brainfart. Removed it. Another passable solution would be
case windowScene(_: Any, windowLevel: UIWindow.Level)
and casting the associated value to UIWindowScene where needed (just one location in
SwiftMessages.Config+Extensions.swift
).This does remove compile-time guarantee but requires no changes to applications and is the smallest change that could be made to fix it I believe. Dropping iOS 12 is certainly an option, but poses a problem for application developers where decisions regarding minimum targets are out of their hands.
Can we go with this solution? This seems to be optimal. @wtmoose
A quick fix using case windowScene(_: Any, windowLevel: UIWindow.Level)
is on branch work/9.0.4
for folks to try.
Version 10 will revert back to case windowScene(_: UIWindowScene, windowLevel: UIWindow.Level)
and instead require iOS 13.
Any update on this?
We tried the latest version and still saw the same issue. The quick fix mentioned by @wtmoose worked. I may have missed something here but why could you make that as the official fix? Also some apps still support iOS 12 so dropping iOS 12 is not desired.
I submitted PR to solve this issue. Please check it out!
Looks like the issue is solved with Xcode 13 RC.
Woah, nice! I'll take a look when I get a chance to install the new build
@rizwan95 same issues in Xcode 13 RC too
Any update on fixing this issue?
@bogartpi the issue is fixed on branch 9.0.4. Does anyone know the released date of 9.0.4?
Please, release fix. We really need it. That is our single library that can't be build in Xcode 13.
@rizwan95 9.0.4 released. Thanks!
Thanks a lot @wtmoose!
When we try to build SwiftMessages with Xcode 13 beta, the following error is being thrown:
Enum cases with associated values cannot be marked potentially unavailable with '@available'