You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a UITextfield in a table view cell, table view will have a wrong content offset after this field become first responder, if you toggle iOS's user interface style.
The code causing the problem:
public class ThemeContainer {
public static var windowsContainer: WindowsContainer = UIApplication.shared
public static var currentTheme: ThemeProtocol! {
didSet {
if let old = oldValue {
old.appearanceRules.revert()
}
windowsContainer.windows.forEach { window in
window.applyTheme(currentTheme)
}
}
}
}
The text was updated successfully, but these errors were encountered:
The problem will arise after I tap the dark mode button in iOS control center.
I solved the problem in this way:
public class ThemeContainer {
public static var windowsContainer: WindowsContainer = UIApplication.shared
public static var currentTheme: ThemeProtocol! {
didSet {
if let old = oldValue {
old.appearanceRules.revert()
}
windowsContainer.windows.forEach { window in
if window is ThemedWindow {
window.applyTheme(currentTheme)
}
}
}
}
}
I have a UITextfield in a table view cell, table view will have a wrong content offset after this field become first responder, if you toggle iOS's user interface style.
The code causing the problem:
The text was updated successfully, but these errors were encountered: