Niels
Niels

Reputation: 435

Disable split view using Swift UI on iPad

Is there a way to disable the SplitView using SwiftUI on iPad inside a navigation view?

Upvotes: 17

Views: 6500

Answers (1)

lorem ipsum
lorem ipsum

Reputation: 29242

By setting the NavigationViewStyle

import SwiftUI

struct NavView: View {
    var body: some View {
        NavigationView{
            List{
                NavigationLink(destination: TestView(), label: {Text("TestView")})
            }
        }.navigationViewStyle(StackNavigationViewStyle())
    }
}

struct NavView_Previews: PreviewProvider {
    static var previews: some View {
        NavView()
    }
}

Upvotes: 46

Related Questions