Skip to content

Commit

Permalink
[0.1.8] Check
Browse files Browse the repository at this point in the history
  • Loading branch information
shial4 committed Jun 21, 2018
1 parent 3123be1 commit 51375f6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Binary file not shown.
6 changes: 3 additions & 3 deletions Sources/SWindow/SWindow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ extension SModalPresentation where Self: UIViewController {
/// - controller: Controller to replace current presented one
/// - animated: Boolean value idicating if operation should be animated
/// - completion: Completion block called on the end of operation
public func sReplace<T: UIViewController>(with controller: T, animated: Bool = false, completion: (() -> Void)? = nil) {
public func sReplace<T: UIViewController>(with controller: T, animated: Bool = false, completion: (() -> Void)? = nil) where T: SModalPresentation {
DispatchQueue.main.async {
if animated {
SModal.modalWindow.isHidden = false
Expand Down Expand Up @@ -196,8 +196,8 @@ extension SModalPresentation where Self: UIViewController {
return
}
SModal.stack.append(self)
if currentPresented.canDismiss == true {
currentPresented.sWithdraw(animated: animated, completion: completion)
if (currentPresented as? SModalPresentation)?.canDismiss == true {
(currentPresented as? SModalPresentation)?.sWithdraw(animated: animated, completion: completion)
} else {
completion?()
}
Expand Down

0 comments on commit 51375f6

Please # to comment.