Created
January 8, 2016 21:27
-
-
Save Teino1978-Corp/4a440a8ddc820a62551a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
searchController.searchBar.forEachSubviewOfClass(UITextField.self) { textField in | |
let textField = textField as! UITextField | |
textField.textColor = .whiteColor() | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension UIView { | |
func forEachSubviewOfClass(type: UIView.Type, apply: (UIView)->()) { | |
for view in subviews { | |
if view.isKindOfClass(type) { | |
apply(view) | |
} else { | |
view.forEachSubviewOfClass(type, apply: apply) | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment