Daltron / NotificationBanner

The easiest way to display highly customizable in app notification banners in iOS
MIT License
4.77k stars 660 forks source link

Fix compile time error in Xcode 13 beta #361

Closed manucheri closed 2 years ago

manucheri commented 3 years ago

When compiling in Xcode 13 beta 3 this error occurs: 'shared' is unavailable in application extensions for iOS: Use view controller based solutions where appropriate instead.

It happens everywhere UIApplication.shared was called.

Solved by marking the classes/extensions/methods that either directly or indirectly call it as explicitly unavailable in app extensions. There might be a cleaner way to do this, but seems like this solved the immediate problem.

See: https://developer.apple.com/documentation/xcode-release-notes/xcode-13-beta-release-notes - issue 66928265 for the change in Xcode that introduced the surfacing of this error. Attached part of screenshot from that site below showing the relevant section:

Screenshot 2021-08-05 at 17 27 43

Tested on Xcode 13 beta 3 and beta 4, where it compiles successfully.

This should probably fix: https://github.com/Daltron/NotificationBanner/issues/358

ShoMasegi commented 3 years ago

@Daltron Please review this PR:pray:

ShoMasegi commented 2 years ago

Sorry, no longer needed with beta5👀

manucheri commented 2 years ago

As @ShoMasegi wrote, it seems Apple backtracked on this change. So I'm closing this PR.