I\'m wondering about changing the color of the cursor / caret in a UITextField (And UITextView if its the same answer) in iOS. I\'ve seen answers f
UITextField
UITextView
If the UITextField is from UISearchBar then first get the textField from searchBar and then apply tintColor property:
UISearchBar
textField
searchBar
tintColor
let textFieldInsideSearchBar = searchBar.value(forKey: "searchField") as? UITextField textFieldInsideSearchBar?.tintColor = UIColor.lightGray