Another feed experiment

This commit is contained in:
Ali
2022-03-18 22:55:06 +04:00
parent fe0311b1e9
commit a9c595a640
128 changed files with 3524 additions and 957 deletions

View File

@@ -71,7 +71,12 @@ public func reverseGeocodeLocation(latitude: Double, longitude: Double) -> Signa
let geocoder = CLGeocoder()
geocoder.reverseGeocodeLocation(CLLocation(latitude: latitude, longitude: longitude), completionHandler: { placemarks, _ in
if let placemarks = placemarks, let placemark = placemarks.first {
let result = ReverseGeocodedPlacemark(street: placemark.thoroughfare, city: placemark.locality, country: placemark.country)
let result: ReverseGeocodedPlacemark
if placemark.thoroughfare == nil && placemark.locality == nil && placemark.country == nil {
result = ReverseGeocodedPlacemark(street: placemark.name, city: nil, country: nil)
} else {
result = ReverseGeocodedPlacemark(street: placemark.thoroughfare, city: placemark.locality, country: placemark.country)
}
subscriber.putNext(result)
subscriber.putCompletion()
} else {