File tree Expand file tree Collapse file tree 2 files changed +3
-27
lines changed Expand file tree Collapse file tree 2 files changed +3
-27
lines changed Original file line number Diff line number Diff line change 88
99import UIKit
1010import Rover
11- import SafariServices
1211
1312class InboxTableViewController : UITableViewController {
1413
@@ -93,10 +92,7 @@ class InboxTableViewController: UITableViewController {
9392
9493 switch message. action {
9594 case . Website:
96- guard let url = message. url where url. scheme == " http " || url. scheme == " https " else { break }
97- let safariViewController = SFSafariViewController ( URL: url)
98- navigationController? . pushViewController ( safariViewController, animated: true )
99- break
95+ fallthrough
10096 case . DeepLink:
10197 guard let url = message. url else { break }
10298 UIApplication . sharedApplication ( ) . openURL ( url)
@@ -132,8 +128,7 @@ class InboxTableViewController: UITableViewController {
132128
133129extension InboxTableViewController : ScreenViewControllerDelegate {
134130 func screenViewController( viewController: ScreenViewController , handleOpenURL url: NSURL ) {
135- let safariViewController = SFSafariViewController ( URL: url)
136- viewController. navigationController? . pushViewController ( safariViewController, animated: true )
131+ UIApplication . sharedApplication ( ) . openURL ( url)
137132 }
138133}
139134
Original file line number Diff line number Diff line change 88
99import Foundation
1010import CoreLocation
11- import SafariServices
1211
1312@objc
1413public class Rover : NSObject {
@@ -176,14 +175,7 @@ public class Rover : NSObject {
176175 public class func followAction( message message: Message ) {
177176 switch message. action {
178177 case . Website:
179- if let url = message. url where url. scheme == " http " || url. scheme == " https " {
180- if #available( iOS 9 . 0 , * ) {
181- let viewController = SFSafariViewController ( URL: url)
182- presentViewController ( viewController)
183- } else {
184- // Fallback on earlier versions
185- }
186- }
178+ fallthrough
187179 case . DeepLink:
188180 if let url = message. url {
189181 UIApplication . sharedApplication ( ) . openURL ( url)
@@ -264,17 +256,6 @@ public class Rover : NSObject {
264256 }
265257 }
266258
267- func presentSafariViewController( url url: NSURL ) {
268- if #available( iOS 9 . 0 , * ) {
269- let viewController = SFSafariViewController ( URL: url)
270-
271- Rover . presentViewController ( viewController)
272- } else {
273- // Fallback on earlier versions
274- UIApplication . sharedApplication ( ) . openURL ( url)
275- }
276- }
277-
278259 public class func presentViewController( viewController: UIViewController ) {
279260 var frame = UIScreen . mainScreen ( ) . bounds
280261 if UIDeviceOrientationIsLandscape ( UIDevice . currentDevice ( ) . orientation) {
You can’t perform that action at this time.
0 commit comments