Skip to content

Commit

Permalink
Merge pull request #145 from ruby109/fix-wrong-protocol-name-in-example
Browse files Browse the repository at this point in the history
Change wrong protocol name in the example project
  • Loading branch information
OhKanghoon authored Jun 19, 2022
2 parents c230fc5 + 60594f6 commit 37bc2b0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Example/Sources/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import URLNavigator
class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?
private var navigator: NavigatorType?
private var navigator: NavigatorProtocol?

func application(
_ application: UIApplication,
Expand Down
6 changes: 3 additions & 3 deletions Example/Sources/Navigator/NavigationMap.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import UIKit
import URLNavigator

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

private static func alert(navigator: NavigatorType) -> URLOpenHandlerFactory {
private static func alert(navigator: NavigatorProtocol) -> URLOpenHandlerFactory {
return { url, values, context in
guard let title = url.queryParameters["title"] else { return false }
let message = url.queryParameters["message"]
let alertController = UIAlertController(title: title, message: message, preferredStyle: .alert)
alertController.addAction(UIAlertAction(title: "OK", style: .default, handler: nil))
navigator.present(alertController)
navigator.present(alertController, wrap: nil, from: nil, animated: true, completion: nil)
return true
}
}
Expand Down
4 changes: 2 additions & 2 deletions Example/Sources/ViewControllers/UserListViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class UserListViewController: UIViewController {

// MARK: Properties

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

// MARK: Initializing

init(navigator: NavigatorType) {
init(navigator: NavigatorProtocol) {
self.navigator = navigator
super.init(nibName: nil, bundle: nil)
self.title = "GitHub Users"
Expand Down
4 changes: 2 additions & 2 deletions Example/Sources/ViewControllers/UserViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ final class UserViewController: UIViewController {

// MARK: Properties

private let navigator: NavigatorType
private let navigator: NavigatorProtocol
let username: String
var repos = [Repo]()

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

// MARK: Initializing

init(navigator: NavigatorType, username: String) {
init(navigator: NavigatorProtocol, username: String) {
self.navigator = navigator
self.username = username
super.init(nibName: nil, bundle: nil)
Expand Down

0 comments on commit 37bc2b0

Please sign in to comment.