winit
winit copied to clipboard
Allow the user to register the application delegate on macOS and iOS
Register for event-loop lifecycle events using the NSNotification
API instead of application delegates. This gives the user full control over the application delegate, which opens several doors for customization that were previously closed.
In particular, this fixes https://github.com/rust-windowing/winit/issues/1751, closes https://github.com/rust-windowing/winit/pull/3713, fixes https://github.com/rust-windowing/winit/issues/2674, fixes https://github.com/rust-windowing/winit/pull/3499, fixes https://github.com/rust-windowing/winit/pull/3650 and fixes https://github.com/rust-windowing/winit/pull/2141, all by allowing the user to override [NS|UI]ApplicationDelegate
themselves outside Winit.
Also fixes https://github.com/rust-windowing/winit/issues/1281 by listening on notifications instead of using the application delegate.
Resolves part of the macOS side of https://github.com/rust-windowing/winit/issues/2120.
- Tested on all platforms changed
- [x] macOS
- [x] iOS
- [x] Added an entry to the
changelog
module if knowledge of this change could be valuable to users - [x] Updated documentation to reflect any user-facing changes, including notes of platform-specific behavior