-
Notifications
You must be signed in to change notification settings - Fork 99
Open
Description
I notice my App some time Loaf stop showing, I made some debug inside the library and I noticed the issue because of this condition "isPresenting == false".
fileprivate func presentIfPossible() {
guard isPresenting == false, let loaf = queue.dequeue(), let sender = loaf.sender else { return }
isPresenting = true
let loafVC = LoafViewController(loaf)
loafVC.delegate = self
sender.presentToast(loafVC)
}
in my case, I fire dismiss in my controller view while Loaf is still showing will dismis Loaf and will not fire blow code especially "self?.delegate?.loafDidDismiss()"
DispatchQueue.main.asyncAfter(deadline: .now() + loaf.duration.length, execute: {
self.dismiss(animated: true) { [weak self] in
self?.delegate?.loafDidDismiss()
self?.loaf.completionHandler?(.timedOut)
}
})
I fixed this by add override dismiss func in Loaf ViewController
override func dismiss(animated flag: Bool, completion: (() -> Void)? = nil) {
super.dismiss(animated: flag, completion: completion)
self.delegate?.loafDidDismiss()
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels