In my app I have set a searcher like this:
searchBar.delegate = self
searchBar.showsCancelButton = true
searchBar.tintColor = UIColor.whiteColor()
searchBar.spellCheckingType = .No
searchBar.autocapitalizationType = .None
searchBar.autocorrectionType = .No
searchBar.returnKeyType = .Done
searchBar.sizeToFit()
let view: UIView = self.searchBar.subviews[0] as UIView
for subView: UIView in view.subviews {
if subView.isKindOfClass(UITextField){
subView.tintColor = UIColor.greenColor()
}
}
this code part set an white text color for my cancel button and a green color for my search field.
as you can see, the cursor will be green, but the text color is black. what is my mistake?