diff --git a/Sources/ComponentsKit/Components/Modal/UIKit/UKBottomModalController.swift b/Sources/ComponentsKit/Components/Modal/UIKit/UKBottomModalController.swift index 49ef36d..802a14d 100644 --- a/Sources/ComponentsKit/Components/Modal/UIKit/UKBottomModalController.swift +++ b/Sources/ComponentsKit/Components/Modal/UIKit/UKBottomModalController.swift @@ -104,11 +104,11 @@ public class UKBottomModalController: UKModalController { animated flag: Bool, completion: (() -> Void)? = nil ) { - UIView.animate(withDuration: self.model.transition.value) { + UIView.animate(withDuration: flag ? self.model.transition.value : 0.0) { self.contentView.transform = .init(translationX: 0, y: self.view.screenBounds.height) self.overlay.alpha = 0 } completion: { _ in - super.dismiss(animated: false) + super.dismiss(animated: false, completion: completion) } } } diff --git a/Sources/ComponentsKit/Components/Modal/UIKit/UKCenterModalController.swift b/Sources/ComponentsKit/Components/Modal/UIKit/UKCenterModalController.swift index fffdc56..8f6387c 100644 --- a/Sources/ComponentsKit/Components/Modal/UIKit/UKCenterModalController.swift +++ b/Sources/ComponentsKit/Components/Modal/UIKit/UKCenterModalController.swift @@ -105,11 +105,11 @@ public class UKCenterModalController: UKModalController { animated flag: Bool, completion: (() -> Void)? = nil ) { - UIView.animate(withDuration: self.model.transition.value) { + UIView.animate(withDuration: flag ? self.model.transition.value : 0.0) { self.overlay.alpha = 0 self.contentView.alpha = 0 } completion: { _ in - super.dismiss(animated: false) + super.dismiss(animated: false, completion: completion) } } }