bigmountainstudio / FullScreenFromTabView

How to navigate from a TabView to another view that covers the TabView.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FullScreenFromTabView

How to navigate from a TabView to another view that covers the TabView.

Starting View is a TabView

Tab

Navigate to a full screen view

Notice it is covering the TabView here:

fullscreen

Add Animation with a Transition

Note: The animation modifier could exist right below the transition modifier. Creating a VStack and adding it there just allows you to preview it.

struct MainView: View {
    @EnvironmentObject var navigationOO: NavigationOO
    
    var body: some View {
        VStack {
            if navigationOO.navigateToFullScreenView {
                FullScreenView()
                    .transition(.move(edge: .trailing))
            } else {
                TabViewScreen()
            }
        }
        .animation(.default)
    }
}

Reference

See this video for reference regarding conditional navigation like this and using transitions.

About

How to navigate from a TabView to another view that covers the TabView.


Languages

Language:Swift 100.0%