UIViewController
extension UIViewController
We add a couple of computed properties to report Dark Mode and High-Contrast Mode.
-
Returns true, if we are in Dark Mode.
Declaration
Swift
@MainActor var isDarkMode: Bool { get } -
Returns true, if we are in High Contrast Mode.
Declaration
Swift
@MainActor var isHighContrastMode: Bool { get } -
Returns true, if we are in Reduced Transparency Mode.
Declaration
Swift
@MainActor var isReducedTransparencyMode: Bool { get }
-
This returns the first responder, wherever it is in our hierarchy.
Declaration
Swift
@MainActor var currentFirstResponder: UIResponder? { get } -
This puts away any open keyboards.
Declaration
Swift
@MainActor func resignAllFirstResponders()
View on GitHub