SwiftMessages
SwiftMessages copied to clipboard
Problem when use "overrideUserInterfaceStyle" on iOS 13
Hi,
I suggest use:
if #available(iOS 13, *) {
/// Doing this because there was a issue reported when trying to set the overrideUserInterfaceStyle directly by the normal API.
if window.responds(to: #selector(setter: UIView.overrideUserInterfaceStyle)) {
window.setValue(config.overrideUserInterfaceStyle.rawValue, forKeyPath: #keyPath(UIView.overrideUserInterfaceStyle))
}
}
In this line: https://github.com/SwiftKickMobile/SwiftMessages/blob/c5026484ff555db961ec549162e4026b017aa6c5/SwiftMessages/WindowViewController.swift#L31
Thanks.
Related to the issue I had, which was closed. @wtmoose
The real fix is:
if #available(iOS 13, *) {
if window.responds(to: #selector(setter: UIView.overrideUserInterfaceStyle)) {
window.setValue(config.overrideUserInterfaceStyle.rawValue, forKeyPath: #keyPath(UIView.overrideUserInterfaceStyle))
}
}
On this line: https://github.com/SwiftKickMobile/SwiftMessages/blob/master/SwiftMessages/WindowViewController.swift#L31
See my fix: https://github.com/ubook-editora/SwiftMessages/commit/68bda98d76a00a6f40526df63346e292b8f7bebf
Could you please define the actual problem?