Post

Replies

Boosts

Views

Activity

Reply to [iOS 18] UITabBarController disable new switching animation
final class TabBarController: UITabBarController { override func viewDidLoad() { super.viewDidLoad() if #available(iOS 18.0, *) { delegate = self } } } extension TabBarController: UITabBarControllerDelegate { func tabBarController(_ tabBarController: UITabBarController, animationControllerForTransitionFrom fromVC: UIViewController, to toVC: UIViewController) -> UIViewControllerAnimatedTransitioning? { return self } } extension TabBarController: UIViewControllerAnimatedTransitioning { func transitionDuration(using transitionContext: (any UIViewControllerContextTransitioning)?) -> TimeInterval { return .zero } func animateTransition(using transitionContext: any UIViewControllerContextTransitioning) { guard let view = transitionContext.view(forKey: .to) else { return } let container = transitionContext.containerView container.addSubview(view) transitionContext.completeTransition(true) } }
Sep ’24