Moved Add NetNewsWire feed to about section, and hide it if they don’t have any active feeds

This commit is contained in:
Phil Viso
2019-05-19 18:35:45 -05:00
parent 8ca14e2b95
commit 02a7130415
2 changed files with 34 additions and 25 deletions

View File

@@ -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")