Skip to content

Commit 37bc2b0

Browse files
authored
Merge pull request #145 from ruby109/fix-wrong-protocol-name-in-example
Change wrong protocol name in the example project
2 parents c230fc5 + 60594f6 commit 37bc2b0

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

Example/Sources/AppDelegate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import URLNavigator
1414
class AppDelegate: UIResponder, UIApplicationDelegate {
1515

1616
var window: UIWindow?
17-
private var navigator: NavigatorType?
17+
private var navigator: NavigatorProtocol?
1818

1919
func application(
2020
_ application: UIApplication,

Example/Sources/Navigator/NavigationMap.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import UIKit
1212
import URLNavigator
1313

1414
enum NavigationMap {
15-
static func initialize(navigator: NavigatorType) {
15+
static func initialize(navigator: NavigatorProtocol) {
1616
navigator.register("navigator://user/<username>") { url, values, context in
1717
guard let username = values["username"] as? String else { return nil }
1818
return UserViewController(navigator: navigator, username: username)
@@ -37,13 +37,13 @@ enum NavigationMap {
3737
return SFSafariViewController(url: url)
3838
}
3939

40-
private static func alert(navigator: NavigatorType) -> URLOpenHandlerFactory {
40+
private static func alert(navigator: NavigatorProtocol) -> URLOpenHandlerFactory {
4141
return { url, values, context in
4242
guard let title = url.queryParameters["title"] else { return false }
4343
let message = url.queryParameters["message"]
4444
let alertController = UIAlertController(title: title, message: message, preferredStyle: .alert)
4545
alertController.addAction(UIAlertAction(title: "OK", style: .default, handler: nil))
46-
navigator.present(alertController)
46+
navigator.present(alertController, wrap: nil, from: nil, animated: true, completion: nil)
4747
return true
4848
}
4949
}

Example/Sources/ViewControllers/UserListViewController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class UserListViewController: UIViewController {
1414

1515
// MARK: Properties
1616

17-
private let navigator: NavigatorType
17+
private let navigator: NavigatorProtocol
1818
let users = [
1919
User(name: "devxoul", urlString: "navigator://user/devxoul"),
2020
User(name: "apple", urlString: "navigator://user/apple"),
@@ -32,7 +32,7 @@ class UserListViewController: UIViewController {
3232

3333
// MARK: Initializing
3434

35-
init(navigator: NavigatorType) {
35+
init(navigator: NavigatorProtocol) {
3636
self.navigator = navigator
3737
super.init(nibName: nil, bundle: nil)
3838
self.title = "GitHub Users"

Example/Sources/ViewControllers/UserViewController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ final class UserViewController: UIViewController {
1414

1515
// MARK: Properties
1616

17-
private let navigator: NavigatorType
17+
private let navigator: NavigatorProtocol
1818
let username: String
1919
var repos = [Repo]()
2020

@@ -26,7 +26,7 @@ final class UserViewController: UIViewController {
2626

2727
// MARK: Initializing
2828

29-
init(navigator: NavigatorType, username: String) {
29+
init(navigator: NavigatorProtocol, username: String) {
3030
self.navigator = navigator
3131
self.username = username
3232
super.init(nibName: nil, bundle: nil)

0 commit comments

Comments
 (0)