Change links to open in inline Safari browser.

This commit is contained in:
Maurice Parker
2019-10-21 17:52:29 -05:00
parent cbf37d4ee0
commit 3f974c7c2b
2 changed files with 37 additions and 11 deletions

View File

@@ -8,6 +8,7 @@
import UIKit
import Account
import SafariServices
class SettingsViewController: UITableViewController {
@@ -135,17 +136,19 @@ class SettingsViewController: UITableViewController {
let timeline = UIStoryboard.settings.instantiateController(ofType: AboutViewController.self)
self.navigationController?.pushViewController(timeline, animated: true)
case 1:
UIApplication.shared.open(URL(string: "https://ranchero.com/netnewswire/")!, options: [:])
openURL("https://ranchero.com/netnewswire/")
case 2:
UIApplication.shared.open(URL(string: "https://github.com/brentsimmons/NetNewsWire")!, options: [:])
openURL("https://github.com/brentsimmons/NetNewsWire/blob/master/Technotes/HowToSupportNetNewsWire.markdown")
case 3:
UIApplication.shared.open(URL(string: "https://github.com/brentsimmons/NetNewsWire/issues")!, options: [:])
openURL("https://github.com/brentsimmons/NetNewsWire")
case 4:
UIApplication.shared.open(URL(string: "https://github.com/brentsimmons/NetNewsWire/tree/master/Technotes")!, options: [:])
openURL("https://github.com/brentsimmons/NetNewsWire/issues")
case 5:
openURL("https://github.com/brentsimmons/NetNewsWire/tree/master/Technotes")
case 6:
addFeed()
default:
UIApplication.shared.open(URL(string: "https://ranchero.com/netnewswire/")!, options: [:])
break
}
default:
break
@@ -286,4 +289,10 @@ private extension SettingsViewController {
}
func openURL(_ urlString: String) {
let vc = SFSafariViewController(url: URL(string: urlString)!)
vc.modalPresentationStyle = .pageSheet
present(vc, animated: true)
}
}