SwiftUI: Animate Tab bar tab switch with a CrossDissolve slide?

Prafulla Singh
2 min readApr 18, 2021

XCode 12 — iOS 14

In this tutorial, We are going to implement CrossDissolve slide animation for Tab bar view.

We cannot achieve CrossDissolve animation in SwiftUI itself, unless we create custom tab bar. In this tutorial, We are going to implement crossDissolve for native Tab-bar.

As Tabbar does not give any API to add custom animation, We are going to inspect Tab-bar for UIKit’s UITabbar. After getting UITabbar, we implement the animation.

To get UITabbar using following library.

import SwiftUI
import Introspect //To Get UIView in view hierarchy
@main
struct
LoopingVideoApp: App {
var body: some Scene {
WindowGroup {
TabView {
NavigationView {
List {
Text("Menu list item 1")
}.navigationBarTitle("Menu")
}.tabItem {
Label("Menu", systemImage: "list.dash")
}
NavigationView {
List{
Text("Order list item 1")…

--

--