Add extension to openURL in safari

pull/2/head
Michael Scoff 7 years ago
parent 229813a1bd
commit 2485a1f297
  1. 6
      Trust/Extensions/UIViewController.swift
  2. 6
      Trust/Settings/ViewControllers/SettingsViewController.swift

@ -4,6 +4,7 @@ import Foundation
import UIKit import UIKit
import Result import Result
import MBProgressHUD import MBProgressHUD
import SafariServices
enum ConfirmationError: LocalizedError { enum ConfirmationError: LocalizedError {
case cancel case cancel
@ -47,4 +48,9 @@ extension UIViewController {
func hideLoading(animated: Bool = true) { func hideLoading(animated: Bool = true) {
MBProgressHUD.hide(for: view, animated: animated) MBProgressHUD.hide(for: view, animated: animated)
} }
func openURL(_ url: URL) {
let controller = SFSafariViewController(url: url)
present(controller, animated: true, completion: nil)
}
} }

@ -2,7 +2,6 @@
import UIKit import UIKit
import Eureka import Eureka
import SafariServices
import VENTouchLock import VENTouchLock
import StoreKit import StoreKit
@ -204,9 +203,4 @@ class SettingsViewController: FormViewController {
func run(action: SettingsAction) { func run(action: SettingsAction) {
delegate?.didAction(action: action, in: self) delegate?.didAction(action: action, in: self)
} }
func openURL(_ url: URL) {
let controller = SFSafariViewController(url: url)
present(controller, animated: true, completion: nil)
}
} }

Loading…
Cancel
Save