I can't answer Matteo in the comments, so I do it here. In addition, it may be useful for future reference.
If you want to add a color that defines the RGB code, there is one simple trick.
The documentation states that the UIColor initWithRed: green: blue: alpha method accepts CGFLoat values ββwhose values ββare between 0.0 and 1.0
Therefore, instead of executing UIColor(Red:255.0, green:252.0, blue:227.0, alpha:1.0) , which will not work, follow these steps:
let red:CGFLoat = 255/255 let green:CGFloat = 252/255 let blue:CGFloat = 227/255 UIColor(red:red, green:green, blue:blue,alpha:1.0)
this works fine inside searchDisplayController (UISearchDisplayController: controller, didLoadSearchResultsTableView UITableView: tableView)
it's fast, but you can easily translate this to obj C
FranΓ§ois
source share