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.
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:
Tested on Xcode 13 beta 3 and beta 4, where it compiles successfully.
This should probably fix: https://github.com/Daltron/NotificationBanner/issues/358