class AppDelegate: UIResponder, UIApplicationDelegate {
//... truncated
func application(application: UIApplication!, didFinishLaunchingWithOptions launchOptions: NSDictionary!) -> Bool {
// set up your background color view
let colorView = UIView()
colorView.backgroundColor = UIColor.yellowColor()
// use UITableViewCell.appearance() to configure
// the default appearance of all UITableViewCells in your app
UITableViewCell.appearance().selectedBackgroundView = colorView
return true
}
//... truncated
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
let selectionView = UIView()
selectionView.backgroundColor = UIColor.green
// selectionView.alpha = 0.3 // optional if you want to tone down a colour
self.selectedBackgroundView = selectionView
}