From 0f975882ee1c1b643dd8ab81909630b2bd68c763 Mon Sep 17 00:00:00 2001 From: Bob Sun Date: Sat, 25 Feb 2017 11:40:12 +0800 Subject: [PATCH] remove hardcoded index path of setting cell --- pass/Controllers/GeneralSettingsTableViewController.swift | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pass/Controllers/GeneralSettingsTableViewController.swift b/pass/Controllers/GeneralSettingsTableViewController.swift index 2e08045..edfeadd 100644 --- a/pass/Controllers/GeneralSettingsTableViewController.swift +++ b/pass/Controllers/GeneralSettingsTableViewController.swift @@ -18,16 +18,18 @@ class GeneralSettingsTableViewController: BasicStaticTableViewController { tableData = [ // section 0 [[.title: "About Repository", .action: "segue", .link: "showAboutRepositorySegue"],], + + // section 1 [[.title: "Hide Unknown Fields", .action: "none",],], ] super.viewDidLoad() - + } override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = super.tableView(tableView, cellForRowAt: indexPath) - if indexPath == IndexPath(row: 0, section: 1) { + if cell.textLabel?.text == "Hide Unknown Fields" { cell.accessoryType = .none hideUnknownSwitch.onTintColor = UIColor(displayP3Red: 0, green: 122.0/255, blue: 1, alpha: 1) hideUnknownSwitch.sizeToFit()