UIAppearance
does not support to change the background color of tableview in globally, you need to create the extension that inherits from UITableView, here is a link to an answer containing a list of all methods supported by UIAppearance
.
for e.g
extension UITableView {
func setBGforTable(){
let divideCount: CGFloat = 255.0
self.backgroundColor = UIColor(red:0.20/divideCount, green:0.22/divideCount, blue:0.29/divideCount, alpha:1.0)
}
}
and call the method in your VC as
override func viewDidLoad() {
super.viewDidLoad()
yourtableViewName.setBGforTable()
}