Skip to content

Commit

Permalink
Notify delegate method after the pan modal is dismissed (slackhq#44)
Browse files Browse the repository at this point in the history
* Notify delegate method after the pan modal is dismissed

* Rename panModalDismissCompleted panModalDidDismiss
  • Loading branch information
shoheiyokoyama authored and Stephen Sowole committed Sep 22, 2019
1 parent 12ac366 commit 0c6f9ff
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
4 changes: 3 additions & 1 deletion PanModal/Controller/PanModalPresentationController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,9 @@ private extension PanModalPresentationController {
*/
func dismissPresentedViewController() {
presentable?.panModalWillDismiss()
presentedViewController.dismiss(animated: true, completion: nil)
presentedViewController.dismiss(animated: true) { [weak self] in
self?.presentable?.panModalDidDismiss()
}
}
}

Expand Down
3 changes: 3 additions & 0 deletions PanModal/Presentable/PanModalPresentable+Defaults.swift
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,7 @@ public extension PanModalPresentable where Self: UIViewController {

}

func panModalDidDismiss() {

}
}
6 changes: 6 additions & 0 deletions PanModal/Presentable/PanModalPresentable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -212,4 +212,10 @@ public protocol PanModalPresentable: AnyObject {
*/
func panModalWillDismiss()

/**
Notifies the delegate after the pan modal is dismissed.

Default value is an empty implementation.
*/
func panModalDidDismiss()
}

0 comments on commit 0c6f9ff

Please sign in to comment.