I am trying to work with a users location in swift and am getting the error "Cannot find 'LocationRequestView' in scope". I am new to swift so I am following a guide on yt to get this part done. On the video this same lines text is in green with no errors. For me I am getting this error. For reference here is my code.
import SwiftUI
struct ContentView: View {
@ObservedObject var locationManager = LocationManager.shared
var body: some View {
//acts as view router(show user one view or another)
Group{
if locationManager.userLocation == nil {
LocationRequestView()
} else{
Text("Hello, World")
.padding()
}
}
}
}
LocationManager is a helper class I have made in a separate file. My instinct is this is an issue with the video being from a year ago but since I am new to swift I can't find where the problem is. Help please.