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)