0
votes

Hello I am stuck and have tried to google and research but am not having any luck. The user location is saying its nil. I am trying to send it to Firebase database to show the users location. When I print out the userLocation.coordinate.latitude manually it shows me the correct coordinates in the console. I have tried to put:

"location": GeoPoint(latitude: userLocation!.coordinate.latitude, longitude: userLocation!.coordinate.longitude)

To possibly unwrap the userlocation but no luck.

I am getting an ERROR:

Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value

Current CODE:

"location": GeoPoint(latitude: userLocation.coordinate.latitude, longitude: userLocation.coordinate.longitude)