Releases: mapbox/MapboxGeocoder.swift
Releases · mapbox/MapboxGeocoder.swift
v0.8.0
- Fixed an issue preventing the initializers of
MBReverseGeocodeOptions
andMBForwardGeocodeOptions
from being available to Objective-C code. (#130) - Fixed a crash that could potentially occur in
Geocoder.geocode(_:completionHandler:)
if the Mapbox Geocoding API returns a malformed response. Now an error would be passed to the completion handler instead. (#127)
v0.7.0
v0.6.3
v0.6.2
v0.6.1
v0.6.0
Changes since v0.5.2:
- Migrated to Swift 3.0. If your application is written in Swift 2.3, you should stick to v0.5.x or use the swift2.3 branch. (#57)
- Fixed an issue causing the error “The sandbox is not in sync with the Podfile.lock” when updating a Carthage-based project that requires this framework. (#96)
- Fixed a crash loading the framework in a pure Objective-C application. (#83)
v0.5.2
This will be the final Swift 2.x release. Changes since v0.5.1:
- Migrated to Swift 2.3.
- Fixed an error that occurred when archiving an application that links to this library. (#66)
- Fixed spurious and sometimes catastrophic “Could not build module” compiler errors. (#63)
- MBForwardGeocodeOptions’
allowedScopes
property is now available in Objective-C. (#63) - Added support for the
Landmark
scope, which is a subset of thePointOfInterest
scope. (#81, #86) - Fixed a crash when using
RectangularRegion.allowedRegion
. (#84) - Fixed a crash that could occur when the user is connected to a captive network. (#71)
- Fixed a crash that occurred when a request failed due to rate limiting. (#92)
- Properties such as
formattedAddressLines
now recognize the reversed and delimiterless address format used in Chinese. (#77) - The user agent string sent by the Mac version of this library now says “macOS” instead of “OS X”. (#58)
v0.5.1
Changes since v0.5.0:
- When the request fails due to rate limiting, an invalid access token, or other invalid input, the completion handler’s
error
parameter contains an NSError object with an explanation of the reason for the failure and a recovery suggestion. (#49, #55) - Renamed
RectangularRegion.containsCoordinate(_:)
tocontains(_:)
to avoid a conflict with an obsolete method in Core Location. (#52) - Requests sent through this library now use a more specific user agent string, so you can more easily identify this library on your Statistics page in Mapbox Studio. (#50)
- Added an experimental
locale
option that determines the display language of geocoder results. (#53)
v0.5.0
This is a complete rewrite of MapboxGeocoder.swift that focuses on making the API more Swift-like in Swift but also improves Objective-C support (#41). The goal is no longer to be a drop-in replacement for Core Location’s CLGeocoder API, but the library continues to use terminology familiar to Cocoa and Cocoa Touch developers. This version includes a number of breaking changes:
- Removed the
MB
class prefix from Swift but kept it for Objective-C. - Added a shared (singleton)
Geocoder
object. Use the shared object if you’ve set your Mapbox access token in theMGLMapboxAccessToken
key of your application’s Info.plist file. (You may have already done so if you’ve installed the Mapbox iOS SDK or Mapbox OS X SDK.) Otherwise, create aGeocoder
object with the access token explicitly. - Simplified the networking part of the library:
- Removed the dependency on RequestKit. If you’re upgrading to this version using CocoaPods, you can remove the
NBNRequestKit
dependency override. Geocoder
no longer needs to be strongly held in order for the request to finish. Instead, the request is made against the shared URL session; to use a custom URL session, make the request yourself using the URL returned by theURLForGeocoding(options:)
property.- A single geocoder object uses the shared URL session for all requests, so it can handle multiple requests concurrently without raising an exception.
- Removed the
cancelGeocode()
method; instead, directly cancel the NSURLSessionDataTask returned bygeocode(options:completionHandler:)
.
- Removed the dependency on RequestKit. If you’re upgrading to this version using CocoaPods, you can remove the
- Replaced
geocodeAddressString(_:completionHandler:)
andreverseGeocodeLocation(_:completionHandler:)
with a singlegeocode(options:completionHandler:)
method that takes aGeocodeOptions
object. The two concrete subclasses ofGeocodeOptions
,ForwardGeocodeOptions
andReverseGeocodeOptions
, support all the options exposed by the Geocoding API. - Added an attribution parameter to the completion handler that contains required legal notices.
- Replaced the
Placemark.Scope
enum with aPlacemarkScope
bitmask. Renamed.AdministrativeArea
to.Region
. - Removed the
CLLocationCoordinate2D
equality operator to avoid conflicts with client code that may define the same.
There are also many breaking changes to the Placemark
object that results from a request to the API:
- For
Placemark
objects representing addresses and points of interest, thename
property is no longer fully qualified; that is, it no longer contains the full administrative hierarchy. For the fully-qualified name, use thequalifiedName
property. - Properties such as
country
andpostalCode
returnPlacemark
objects instead of strings. To get the name of e.g. the surrounding country, use the returned placemark object’sname
property. - Renamed
ISOcountryCode
tocode
. This property may be included in subnational placemarks, such as placemarks representing regions. - Replaced the
administrativeArea
andsubAdministrativeArea
properties withadministrativeRegion
anddistrict
, respectively. Unlike the oldsubAdministrativeRegion
property,district
may benil
if it isn’t applicable. - Renamed
locality
toplace
, andsubLocality
toneighborhood
.
Other changes since v0.4.2:
- Added official support for OS X, tvOS, and watchOS. (#44, #48)
- Added support for the Contacts framework’s
CNPostalAddress
class. You can directly forward geocode aCNPostalAddress
. You can also get thepostalAddress
of a placemark, suitable to format withCNPostalAddressFormatter
or place inside aCNContact
. (#41, #42) - Added options for disabling autocompletion behavior and limiting results to a rectangular region. (#41)
- Added support for batch geocoding requests via
ForwardBatchGeocodeOptions
andForwardReverseGeocodeOptions
. (#41) - When a request fails, the returned error includes a failure reason. When the error is due to rate-limiting, the error also includes a hint that indicates how long to wait before making another request. (#41)
- A new
superiorPlacemarks
property returns the entire hierarchy of placemarks (in indexer order) that contain a given placemark, in case there’s any overlap between containing placemarks. (#41) - Added a
wikidataItemIdentifier
property identifying a placemark’s corresponding Wikidata item. (#41)