Add group by feed setting

This commit is contained in:
Maurice Parker
2019-10-21 16:42:58 -05:00
parent c3a8c9a5ab
commit 48db3d6d85
2 changed files with 60 additions and 14 deletions

View File

@@ -15,6 +15,7 @@ class SettingsViewController: UITableViewController {
@IBOutlet weak var refreshIntervalLabel: UILabel!
@IBOutlet weak var timelineSortOrderSwitch: UISwitch!
@IBOutlet weak var groupByFeedSwitch: UISwitch!
@IBOutlet weak var timelineNumberOfLinesLabel: UILabel!
weak var presentingParentController: UIViewController?
@@ -37,6 +38,12 @@ class SettingsViewController: UITableViewController {
timelineSortOrderSwitch.isOn = false
}
if AppDefaults.timelineGroupByFeed {
groupByFeedSwitch.isOn = true
} else {
groupByFeedSwitch.isOn = false
}
refreshIntervalLabel.text = AppDefaults.refreshInterval.description()
let numberOfLinesText = NSLocalizedString(" lines", comment: "Lines")
@@ -109,7 +116,7 @@ class SettingsViewController: UITableViewController {
self.navigationController?.pushViewController(controller, animated: true)
}
case 1:
if indexPath.row == 1 {
if indexPath.row == 2 {
let timeline = UIStoryboard.settings.instantiateController(ofType: TimelineNumberOfLinesViewController.self)
self.navigationController?.pushViewController(timeline, animated: true)
}
@@ -123,7 +130,7 @@ class SettingsViewController: UITableViewController {
case 2:
exportOPML()
default:
print("export")
break
}
case 3:
switch indexPath.row {
@@ -192,6 +199,14 @@ class SettingsViewController: UITableViewController {
}
}
@IBAction func switchGroupByFeed(_ sender: Any) {
if groupByFeedSwitch.isOn {
AppDefaults.timelineGroupByFeed = true
} else {
AppDefaults.timelineGroupByFeed = false
}
}
@objc func contentSizeCategoryDidChange() {
tableView.reloadData()
}