Невозможно удалить «Необязательно» из строки
Ниже мой фрагмент
// MARK: - Location Functions
func getCurrentLocation() -> (String!, String!) {
let location = LocationManager.sharedInstance.currentLocation?.coordinate
return (String(location?.latitude), String(location?.longitude))
}
func setCurrentLocation() {
let (latitude, longitude) = getCurrentLocation()
let location = "\(latitude!),\(longitude!)"
print(location)
}
Хотя я развернуть необязательно, используяlatitude!
а такжеlongitude!
это печатает меняOptional(37.33233141),Optional(-122.0312186)
Я ломаю голову, чтобы удалить опциональную привязку.