struct ContentView: View {
@StateObject var locationManager = locationManager()
var body: some View {
Text("hello world")
.padding()
}
}
the error is coming on the line with
@StateObject var locationManager = locationManager()
struct ContentView: View {
@StateObject var locationManager = locationManager()
var body: some View {
Text("hello world")
.padding()
}
}
the error is coming on the line with
@StateObject var locationManager = locationManager()
Your variable locationManager
and your type being assigned to that variable have the same name. Typically, you start type names with a capital letter, which avoids this issue completely.
That worked, Thanks !