import SwiftUI

struct ContentView: View {
    private let topics = ["Layouts", "Multitasking", "Camera"]
    @State private var selection: String?

    var body: some View {
        NavigationSplitView {
            List(topics, id: \.self, selection: $selection) { topic in
                NavigationLink(topic, value: topic)
            }
            .navigationTitle("Topics")
        } detail: {
            Text(selection ?? "Choose a topic")
                .font(.title)
                .padding()
        }
    }
}

struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}
