Supports deep linking to Patreon settings

This commit is contained in:
Riley Testut
2019-09-19 14:43:26 -07:00
parent 00a7886941
commit 73c44c5e29
5 changed files with 75 additions and 1 deletions

View File

@@ -49,6 +49,13 @@ class SettingsViewController: UITableViewController
@IBOutlet private var backgroundRefreshSwitch: UISwitch!
required init?(coder aDecoder: NSCoder)
{
super.init(coder: aDecoder)
NotificationCenter.default.addObserver(self, selector: #selector(SettingsViewController.openPatreonSettings(_:)), name: AppDelegate.openPatreonSettingsDeepLinkNotification, object: nil)
}
override func viewDidLoad()
{
super.viewDidLoad()
@@ -191,6 +198,19 @@ private extension SettingsViewController
}
}
private extension SettingsViewController
{
@objc func openPatreonSettings(_ notification: Notification)
{
guard self.presentedViewController == nil else { return }
UIView.performWithoutAnimation {
self.navigationController?.popViewController(animated: false)
self.performSegue(withIdentifier: "showPatreon", sender: nil)
}
}
}
extension SettingsViewController
{
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int