mirror of
https://github.com/lux-tel/session-ios.git
synced 2026-10-30 20:38:32 +00:00
50 lines
1.6 KiB
Swift
50 lines
1.6 KiB
Swift
// Copyright © 2024 Rangeproof Pty Ltd. All rights reserved.
|
|
|
|
import UIKit
|
|
|
|
public extension UINavigationController {
|
|
func pushViewController(_ viewController: UIViewController, animated: Bool, completion: (() -> Void)?) {
|
|
pushViewController(viewController, animated: animated)
|
|
if animated, let coordinator = transitionCoordinator {
|
|
coordinator.animate(alongsideTransition: nil) { _ in
|
|
completion?()
|
|
}
|
|
} else {
|
|
completion?()
|
|
}
|
|
}
|
|
|
|
func popViewController(animated: Bool, completion: (() -> Void)?) {
|
|
popViewController(animated: animated)
|
|
if animated, let coordinator = transitionCoordinator {
|
|
coordinator.animate(alongsideTransition: nil) { _ in
|
|
completion?()
|
|
}
|
|
} else {
|
|
completion?()
|
|
}
|
|
}
|
|
|
|
func popToViewController(_ viewController: UIViewController, animated: Bool, completion: (() -> Void)?) {
|
|
popToViewController(viewController, animated: animated)
|
|
if animated, let coordinator = transitionCoordinator {
|
|
coordinator.animate(alongsideTransition: nil) { _ in
|
|
completion?()
|
|
}
|
|
} else {
|
|
completion?()
|
|
}
|
|
}
|
|
|
|
func popToRootViewController(animated: Bool, completion: (() -> Void)?) {
|
|
popToRootViewController(animated: animated)
|
|
if animated, let coordinator = transitionCoordinator {
|
|
coordinator.animate(alongsideTransition: nil) { _ in
|
|
completion?()
|
|
}
|
|
} else {
|
|
completion?()
|
|
}
|
|
}
|
|
}
|