ContentView.swift


  1. import SwiftUI
  2. struct ContentView: View {
  3. @State private var selection: Tab = .featured
  4. enum Tab {
  5. case featured
  6. case list
  7. }
  8. var body: some View {
  9. TabView(selection: $selection) {
  10. CategoryHome()
  11. .tag(Tab.featured)
  12. LandmarkList()
  13. .tag(Tab.list)
  14. }
  15. }
  16. }
  17. struct ContentView_Previews: PreviewProvider {
  18. static var previews: some View {
  19. ContentView()
  20. .environmentObject(ModelData())
  21. }
  22. }