OK so I rewrote some code,
class Settings: UIViewController, UITableViewDelegate, UITableViewDataSource {
var data = [Settings_Custom_Cell]()
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return data.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
data = [SettingsCell(settingLabel: "Quick Add", settingValue: <#UISwitch#> )]
let cell = table.dequeueReusableCell(withIdentifier: "cell") as! Settings_Custom_Cell
let array = data[indexPath.row]
cell.textLabel?.text = array.settingLabel.text
cell.settingValue.isOn = array.settingValue.isOn
cell.textLabel?.numberOfLines = 0
cell.textLabel?.lineBreakMode = NSLineBreakMode.byWordWrapping
cell.textLabel?.font = UIFont.systemFont(ofSize: 20)
return cell
}
@IBOutlet weak var table: UITableView!
override func viewDidLoad() {
super.viewDidLoad()
}
}
I am not sure if I am on the right track but what do I put in the 'settingValue' value in
data = [SettingsCell(settingLabel: "Quick Add", settingValue: <#UISwitch#> )]