Posts

Post not yet marked as solved
3 Replies
Also, check out Hacking With Swift by Paul Hudson. He has some really great content about SwiftUI on his website, much of which is completely free. I would post a link for you, but the forums won't let me 🙁
Post not yet marked as solved
3 Replies
struct ContentView: View {     /*      This "tabSelection" variable is used by the TabView to      update which tab is currently selected. This value will      correspond to the value of the ".tag" modifer on each      view of the TabView.      The "@State" property wrapper is needed so that SwiftUI      can update the value of this variable.      */     @State     private var tabSelection = 0         var body: some View {         TabView(selection: $tabSelection) {             FirstTabView()                 .tabItem {                     /*                      The ".tabItem" modifier is used to set                       the contents of the button on the tab bar.                      This view will accept an optional Image and/or Text view.                      */                     Image(systemName: "1.square.fill")                     Text("Tab Label 1")                 }                 .tag(0) /* When this tab is selected, tabSelection will update with this value */                       SecondTabView()                 .tabItem {                     Image(systemName: "2.square.fill")                     Text("Tab Label 2")                 }                 .tag(1)         }     } } struct FirstTabView: View {     var body: some View {         /*          This is where you would create the content of your view inside          each tab. Other views, functions, etc.          */         NavigationView {             Text("First Tab View Body")                 .navigationTitle("First")         }     } } struct SecondTabView: View {     var body: some View {         NavigationView {             Text("Second Tab View Body")                 .navigationTitle("Second")         }     } }
Post marked as solved
3 Replies
Feedback Assistant on iOS says "Feedback for this beta has been closed." Experiencing the same in macOS.