forked from slackhq/PanModal
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
presentationController lifeCycle 이벤트 전송 기능 추가
- Loading branch information
Showing
3 changed files
with
66 additions
and
1 deletion.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
PanModal/Controller/PanModalPresentationController+Event.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import UIKit | ||
import Combine | ||
|
||
extension PanModalPresentationController { | ||
// MARK: - Internal Event Emitters | ||
func notifyWillPresent() { | ||
(presentedViewController as? PanModalPresentable)?.panModalWillPresent() | ||
if #available(iOS 13.0, *) { | ||
PanModalLifeCycleEventPublisher.shared.notify(.willPresent(viewController: presentedViewController)) | ||
} | ||
} | ||
|
||
func notifyDidPresent() { | ||
(presentedViewController as? PanModalPresentable)?.panModalDidPresent() | ||
if #available(iOS 13.0, *) { | ||
PanModalLifeCycleEventPublisher.shared.notify(.didPresent(viewController: presentedViewController)) | ||
} | ||
} | ||
|
||
func notifyWillDismiss() { | ||
(presentedViewController as? PanModalPresentable)?.panModalWillDismiss() | ||
if #available(iOS 13.0, *) { | ||
PanModalLifeCycleEventPublisher.shared.notify(.willDismiss(viewController: presentedViewController)) | ||
} | ||
} | ||
|
||
func notifyDidDismiss() { | ||
(presentedViewController as? PanModalPresentable)?.panModalDidDismiss() | ||
if #available(iOS 13.0, *) { | ||
PanModalLifeCycleEventPublisher.shared.notify(.didDismiss(viewController: presentedViewController)) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters