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

    var isDarkMode: Bool { get }
  • Returns true, if we are in High Contrast Mode.

    Declaration

    Swift

    var isHighContrastMode: Bool { get }
  • Returns true, if we are in Reduced Transparency Mode.

    Declaration

    Swift

    var isReducedTransparencyMode: Bool { get }

UIViewController Extension

  • This returns the first responder, wherever it is in our hierarchy.

    Declaration

    Swift

    var currentFirstResponder: UIResponder? { get }
  • This puts away any open keyboards.

    Declaration

    Swift

    func resignAllFirstResponders()