Skip to content

Commit

Permalink
Added dismiss transition and new window root controleer transition
Browse files Browse the repository at this point in the history
  • Loading branch information
shles committed Feb 13, 2019
1 parent 3dc96a6 commit b92c6a1
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
Binary file not shown.
23 changes: 23 additions & 0 deletions Source/Transition.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,26 @@ open class PopTransition: Transition {
}


open class DismissTransition: Transition {
public func perform(on viewController: UIViewController) {
viewController.dismiss(animated: true)
}
}

open class NewWindowRootControllerTransition: Transition {
private let leadingTo: () -> (UIViewController)

init(leadingTo: @escaping () -> (UIViewController)) {
self.leadingTo = leadingTo
}

public func perform(on viewController: UIViewController) {
let vc = leadingTo()
viewController.present(vc, animated: true) {
UIApplication.shared.keyWindow?.rootViewController = vc
}

}
}


0 comments on commit b92c6a1

Please sign in to comment.