SwiftKickMobile / SwiftMessages

A very flexible message bar for UIKit and SwiftUI.
MIT License
7.24k stars 741 forks source link

Support Xcode 13 #478

Closed giginet closed 2 years ago

giginet commented 2 years ago

Motivation

closes #471 Xcode 13 issue - Enum cases with associated values cannot be marked potentially unavailable with '@available' · Issue #471 · SwiftKickMobile/SwiftMessages

Swift 5.5 doesn't support @available annotations on enum cases. According to the forum, It may not be a bug, it seems to be a language spec. [SR-14539] Swift 5.5 errors on enum cases with associated values being marked available - Swift

So I dropped @available from PresentationContext.

Description

Add WindowScene protocol to wrap UIWindowScene. It helps to solve a compatibility issue between iOS versions.

I tried to build SwiftMessages on Xcode and as a Carthage dependency.

wtmoose commented 2 years ago

@giginet are you aware that there is already a fix in place on the work/9.0.4 branch?

giginet commented 2 years ago

@wtmoose

are you aware that there is already a fix in place on the work/9.0.4 branch?

I didn't know. It looks good.

I saw your patch in the branch. However, my patch is safer than using Any. How do you think about it? https://github.com/SwiftKickMobile/SwiftMessages/commit/7ef6043a9bd7e72308a27ef40645fd6df3942ba2

wtmoose commented 2 years ago

The 10.0 version is iOS 13+, so I don't think it matters a whole lot.

wtmoose commented 2 years ago

Going with this. Thanks for your help.