Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce setupPredefinedEnvironmentListeners to allow setup build-in environment listener #3

Merged

Conversation

nonameplum
Copy link
Owner

  • Use setupPredefinedEnvironmentListeners to set up custom hooks that observe the system environment changes.
  • Make all the existing build-in environment setup-listeners public to allow use of them as needed.
  • Use SwiftHook to safely swizzle the UIKit selectors.
    • This fixes the UIWindow.overrideUserInterfaceStyle as internally SwiftHooks makes safety checks if an object is capable of calling the swizzled selector.

This should address the issue #2

…in environment listener

* Use `setupPredefinedEnvironmentListeners` to set up custom hooks that observe the system environment changes.
* Make all the existing build-in environment setup-listeners `public` to allow use of them as needed.
* Use `SwiftHook` to safely swizzle the UIKit selectors.
   * This fixes the `UIWindow.overrideUserInterfaceStyle` as internally `SwiftHooks` makes safety checks if an object is capable of calling the swizzled selector.
@nonameplum nonameplum merged commit 2af6534 into main May 25, 2024
1 check passed
@nonameplum nonameplum deleted the bugfix/fix-overrideUserInterfaceStyle-ios17-swizzling-crash branch May 28, 2024 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant