Skip to content

Commit

Permalink
Remove references to UIViewController for Presenter and SerialHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
Elviro Rocca committed Feb 9, 2018
1 parent 1d26264 commit ae707e0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 20 deletions.
18 changes: 0 additions & 18 deletions NavigationHelperUIKit/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,6 @@ extension Presentable {
}
}

extension ModalPresenter {
public var asViewController: UIViewController? {
return self as? UIViewController
}
}

extension AnyPresenter {
public var asViewController: UIViewController? {
return modalPresenter.asViewController
}
}

extension SerialHandler where Message.Context: ModalPresenter {
public var rootViewController: UIViewController? {
return context.asViewController
}
}

extension UIViewController: ModalPresenter {
public func show(animated: Bool) -> Reader<Presentable, Future<()>> {
return Reader<Presentable, Future<()>>.unfold { presentable in
Expand Down
4 changes: 2 additions & 2 deletions Sources/NavigationHelper/Protocols.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ public protocol StructuredPresenter {
public typealias Presenter = ModalPresenter & StructuredPresenter

public final class AnyPresenter: Presenter {
public let modalPresenter: ModalPresenter
public let structuredPresenter: StructuredPresenter
private let modalPresenter: ModalPresenter
private let structuredPresenter: StructuredPresenter

public init(modalPresenter: ModalPresenter, structuredPresenter: StructuredPresenter) {
self.modalPresenter = modalPresenter
Expand Down

0 comments on commit ae707e0

Please sign in to comment.