appearanceWhenContainedIn in Swift

Update for iOS 9: If you’re targeting iOS 9+ (as of Xcode 7 b1), there is a new method in the UIAppearance protocol which does not use varargs: static func appearanceWhenContainedInInstancesOfClasses(containerTypes: [AnyObject.Type]) -> Self Which can be used like so: UITextField.appearanceWhenContainedInInstancesOfClasses([MyViewController.self]).keyboardAppearance = .Light If you still need to support iOS 8 or earlier, use the … Read more