ninjaprox / NVActivityIndicatorView

A collection of awesome loading animations
MIT License
10.63k stars 1.16k forks source link

Cannot compile with Xcode 13b3: 'shared' is unavailable #338

Open joshuapoq opened 3 years ago

joshuapoq commented 3 years ago

Raising this whilst I'm not sure I'd recommend fixing yet. Follow this thread for a better explanation of the issue.

The following common code is unavailable in iOS app extensions. Code using this code no longer compiles via SPM.

UIApplication.shared

Xcode 13b3 is requiring that frameworks use the following annotation for code using unavailable code.

@available(iOSApplicationExtension, unavailable)

Affected lines of code: https://github.com/ninjaprox/NVActivityIndicatorView/blob/master/Sources/Extended/NVActivityIndicatorPresenter.swift#L309 https://github.com/ninjaprox/NVActivityIndicatorView/blob/master/Sources/Extended/NVActivityIndicatorPresenter.swift#L325

rlziii commented 3 years ago

It seems like this is no longer an issue as of Xcode 13 Beta 5. I can confirm that NVActivityIndicatorView is building correctly for me again. The relevant change in the Xcode 13 release notes:

Swift Packages

Resolved in Xcode 13 Beta 5

You don’t need to annotate code as unavailable for use in application extensions if it references APIs annotated as unavailable for use in application extensions. This reverts a requirement that Xcode 13 Beta 3 introduced. (80615922) (FB9332020)