MapboxGeocoder.swift Versions Save

Address search and reverse geocoding in Swift or Objective-C on iOS, macOS, tvOS, and watchOS

v0.8.0

6 years ago

Changes since v0.7.0:

  • Fixed an issue preventing the initializers of MBReverseGeocodeOptions and MBForwardGeocodeOptions 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

6 years ago

Beginning with this release, MapboxGeocoder.swift is written in Swift 4 (#122). There are no other significant changes since v0.6.3.

v0.6.3

6 years ago

Changes since v0.6.2:

  • Fixed a crash performing batch geocoding with more than one query. (#115)

v0.6.2

7 years ago

Changes since v0.6.1:

  • Fixed a linker error in Objective-C projects about “incompatible Objective-C category definitions”. (#105)

v0.6.1

7 years ago

Changes since v0.6.0:

  • Improved Swift 3.1 compatibility. (#102)

v0.6.0

7 years ago

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

7 years ago

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 the PointOfInterest 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

7 years ago

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(_:) to contains(_:) 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

8 years ago

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 the MGLMapboxAccessToken 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 a Geocoder 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 the URLForGeocoding(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 by geocode(options:completionHandler:).
  • Replaced geocodeAddressString(_:completionHandler:) and reverseGeocodeLocation(_:completionHandler:) with a single geocode(options:completionHandler:) method that takes a GeocodeOptions object. The two concrete subclasses of GeocodeOptions, ForwardGeocodeOptions and ReverseGeocodeOptions, 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 a PlacemarkScope 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, the name property is no longer fully qualified; that is, it no longer contains the full administrative hierarchy. For the fully-qualified name, use the qualifiedName property.
  • Properties such as country and postalCode return Placemark objects instead of strings. To get the name of e.g. the surrounding country, use the returned placemark object’s name property.
  • Renamed ISOcountryCode to code. This property may be included in subnational placemarks, such as placemarks representing regions.
  • Replaced the administrativeArea and subAdministrativeArea properties with administrativeRegion and district, respectively. Unlike the old subAdministrativeRegion property, district may be nil if it isn’t applicable.
  • Renamed locality to place, and subLocality to neighborhood.

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 a CNPostalAddress. You can also get the postalAddress of a placemark, suitable to format with CNPostalAddressFormatter or place inside a CNContact. (#41, #42)
  • Added options for disabling autocompletion behavior and limiting results to a rectangular region. (#41)
  • Added support for batch geocoding requests via ForwardBatchGeocodeOptions and ForwardReverseGeocodeOptions. (#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)

v0.4.2

8 years ago

Changes since v0.4.1:

  • Added the ability to specify a custom host for the server API. (#35)
  • Allow client code to manage any number of running tasks. cancelGeocode() cancels all outstanding tasks. (#36)