remove hardcoded index path of setting cell
This commit is contained in:
parent
c6db44ace7
commit
0f975882ee
1 changed files with 4 additions and 2 deletions
|
|
@ -18,6 +18,8 @@ class GeneralSettingsTableViewController: BasicStaticTableViewController {
|
||||||
tableData = [
|
tableData = [
|
||||||
// section 0
|
// section 0
|
||||||
[[.title: "About Repository", .action: "segue", .link: "showAboutRepositorySegue"],],
|
[[.title: "About Repository", .action: "segue", .link: "showAboutRepositorySegue"],],
|
||||||
|
|
||||||
|
// section 1
|
||||||
[[.title: "Hide Unknown Fields", .action: "none",],],
|
[[.title: "Hide Unknown Fields", .action: "none",],],
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
@ -27,7 +29,7 @@ class GeneralSettingsTableViewController: BasicStaticTableViewController {
|
||||||
|
|
||||||
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
||||||
let cell = super.tableView(tableView, cellForRowAt: indexPath)
|
let cell = super.tableView(tableView, cellForRowAt: indexPath)
|
||||||
if indexPath == IndexPath(row: 0, section: 1) {
|
if cell.textLabel?.text == "Hide Unknown Fields" {
|
||||||
cell.accessoryType = .none
|
cell.accessoryType = .none
|
||||||
hideUnknownSwitch.onTintColor = UIColor(displayP3Red: 0, green: 122.0/255, blue: 1, alpha: 1)
|
hideUnknownSwitch.onTintColor = UIColor(displayP3Red: 0, green: 122.0/255, blue: 1, alpha: 1)
|
||||||
hideUnknownSwitch.sizeToFit()
|
hideUnknownSwitch.sizeToFit()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue