From 02a713041538318bf7c48626d3389d09408dfdd3 Mon Sep 17 00:00:00 2001 From: Phil Viso Date: Sun, 19 May 2019 18:35:45 -0500 Subject: [PATCH] =?UTF-8?q?Moved=20Add=20NetNewsWire=20feed=20to=20about?= =?UTF-8?q?=20section,=20and=20hide=20it=20if=20they=20don=E2=80=99t=20hav?= =?UTF-8?q?e=20any=20active=20feeds?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- iOS/Settings/Settings.storyboard | 42 +++++++++++------------ iOS/Settings/SettingsViewController.swift | 17 ++++++--- 2 files changed, 34 insertions(+), 25 deletions(-) diff --git a/iOS/Settings/Settings.storyboard b/iOS/Settings/Settings.storyboard index 4ce87b266..2636c141e 100644 --- a/iOS/Settings/Settings.storyboard +++ b/iOS/Settings/Settings.storyboard @@ -127,12 +127,29 @@ + + + + + + + + + + + - + @@ -153,7 +170,7 @@ - + @@ -183,7 +200,7 @@ - + @@ -211,7 +228,7 @@ - + @@ -234,23 +251,6 @@ - - - - - - - - - - - diff --git a/iOS/Settings/SettingsViewController.swift b/iOS/Settings/SettingsViewController.swift index f75601269..f395d62d1 100644 --- a/iOS/Settings/SettingsViewController.swift +++ b/iOS/Settings/SettingsViewController.swift @@ -58,6 +58,13 @@ class SettingsViewController: UITableViewController { switch section { case 0: return AccountManager.shared.accounts.count + 1 + case 1: + let defaultNumberOfRows = super.tableView(tableView, numberOfRowsInSection: section) + if AccountManager.shared.activeAccounts.isEmpty { + // Hide the add NetNewsWire feed row if they don't have any active accounts + return defaultNumberOfRows - 1 + } + return defaultNumberOfRows default: return super.tableView(tableView, numberOfRowsInSection: section) } @@ -116,8 +123,12 @@ class SettingsViewController: UITableViewController { UIApplication.shared.open(URL(string: "https://github.com/brentsimmons/NetNewsWire")!, options: [:]) case 3: UIApplication.shared.open(URL(string: "https://github.com/brentsimmons/NetNewsWire/issues")!, options: [:]) - default: + case 4: UIApplication.shared.open(URL(string: "https://github.com/brentsimmons/NetNewsWire/tree/master/Technotes")!, options: [:]) + case 5: + addFeed() + default: + UIApplication.shared.open(URL(string: "https://ranchero.com/netnewswire/")!, options: [:]) } case 2: UIApplication.shared.open(URL(string: "https://appcamp4girls.com/contribute/")!, options: [:]) @@ -132,10 +143,8 @@ class SettingsViewController: UITableViewController { let timeline = UIStoryboard.settings.instantiateController(ofType: RefreshIntervalViewController.self) self.navigationController?.pushViewController(timeline, animated: true) case 1: - addFeed() - case 2: importOPML() - case 3: + case 2: exportOPML() default: print("export")