Skip to content

Commit 8b73032

Browse files
authored
Merge pull request #56 from RoverPlatform/0.4.2
removed SFSafariViewController
2 parents 1f44055 + 333a8c3 commit 8b73032

File tree

2 files changed

+3
-27
lines changed

2 files changed

+3
-27
lines changed

Example/Rover/InboxTableViewController.swift

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
import UIKit
1010
import Rover
11-
import SafariServices
1211

1312
class 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

133129
extension 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

Pod/Classes/Rover.swift

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
import Foundation
1010
import CoreLocation
11-
import SafariServices
1211

1312
@objc
1413
public 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) {

0 commit comments

Comments
 (0)