-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add distance formatter field to MapboxSearchUI.Configuration (#171)
### Description Fixes #168 - Add an optional [MKDistanceFormatter](https://developer.apple.com/documentation/mapkit/mkdistanceformatter) parameter to Configuration that will be used in the suggestion results to format the distance. - If no value is provided then the default system behavior of auto-detecting the device locale for the formatter style will be used. - Update the Examples/SearchExample.xcworkspace project with sample code ### Checklist - [x] Update `CHANGELOG` ### Screenshots | With nil value | With a custom formatter in locale en_US | | -- | -- | | ![Simulator Screen Shot - iPhone 13 - 2024-02-07 at 16 46 34](https://github.com/mapbox/mapbox-search-ios/assets/384288/f65b3f70-7fc2-4214-b369-61b5f570193e) | ![Simulator Screen Shot - iPhone 13 - 2024-02-07 at 16 46 54](https://github.com/mapbox/mapbox-search-ios/assets/384288/a8054483-d1fa-4814-860f-6354cad660a7) | Listing for "With a nil value" screenshot in SimpleUISearchViewController ```swift var configuration = Configuration() ``` Listing for "With a custom formatter in locale en_US" screenshot in SimpleUISearchViewController ```swift let formatter = MKDistanceFormatter() formatter.units = .metric formatter.unitStyle = .full var configuration = Configuration( distanceFormatter: formatter ) ```
- Loading branch information
Showing
6 changed files
with
27 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters