Post

Replies

Boosts

Views

Activity

Error: Value of type 'SettingsView' has no member 'tabItem'
I'm going through the tutorial and have copied the code given to me verbatim, but I am still getting the error 'Value of type 'SettingsView' has no member 'tabItem'. Not sure what to do. Code is below. import SwiftUI @main struct MyApp: App { var body: some Scene { WindowGroup { TabView { ContentView() .tabItem { Label("Journal", systemImage: "book") } SettingsView() .tabItem { *error is here - Value of type 'SettingsView' has no member 'tabItem' Label("Settings", systemImage: "gear") } } } } }
1
0
356
Dec ’24
Expected expression after operator error
Hello, I am going through the swift tutorial and am experiencing an 'expected expression after operator' error in when I am trying to add the favorite button. I'm not quite sure how to fix it. Below is the code and where the error is. import SwiftUI struct LandmarkDetail: View { @Environment(ModelData.self) var modelData var landmark: Landmark var landmarkIndex: Int{ modelData.landmarks.firstIndex(where: { $0.id == landmark.id}) ! } **_expected expression after operator_** var body: some View { @Bindable var modelData = modelData ScrollView { MapView(coordinate: landmark.locationCoordinates) .frame(height: 300) CircleImage(image: landmark.image) .offset(y:-130)
1
0
456
Nov ’24