Skip to content

Commit

Permalink
Merge branch 'main' of github.com:mapbox/mapbox-search-ios into SSDK-…
Browse files Browse the repository at this point in the history
…399-add-country-proximity-origin-to-discover-options

Conflicts:
	CHANGELOG.md
	MapboxSearch.xcodeproj/project.pbxproj
  • Loading branch information
aokj4ck committed Feb 13, 2024
2 parents ebfe723 + 70ca06e commit 807ac1b
Show file tree
Hide file tree
Showing 17 changed files with 166 additions and 53 deletions.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "github-actions" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
6 changes: 3 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ jobs:
sudo xcode-select -s /Applications/Xcode_14.1.app
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -72,6 +72,6 @@ jobs:
./scripts/build_spm_sample.sh
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ Guide: https://keepachangelog.com/en/1.0.0/

- [Discover] Add support for country, proximity, and origin parameters in Discover.Options search parameters. This fixes an issue when using search-along-route to query category results.

- [SearchUI] Add `distanceFormatter` field to Configuration to support changing the search suggestions distance format. Nil values will use the default behavior.

- [Core] Add xcprivacy for MapboxSearch and MapboxSearchUI

- [SearchUI] Update Maki icons to all SVG, latest versions from https://github.com/mapbox/maki
- [SearchUI] Remove all custom Maki icons
- [Unit Tests] Update and correct tests for iOS 17 using all mocked data.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,6 @@
"version": "10.2.0"
}
},
{
"package": "MapboxMobileEvents",
"repositoryURL": "https://github.com/mapbox/mapbox-events-ios.git",
"state": {
"branch": null,
"revision": "e29f48d9ed02b31ef51f9774a9c45f1d7c2c2b78",
"version": "1.0.6"
}
},
{
"package": "MapboxMaps",
"repositoryURL": "[email protected]:mapbox/mapbox-maps-ios.git",
Expand Down
8 changes: 7 additions & 1 deletion Examples/SearchExamples/SimpleUISearchViewController.swift
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
import MapboxMaps
import MapboxSearch
import MapboxSearchUI
import MapKit
import UIKit

class SimpleUISearchViewController: MapsViewController {
lazy var searchController: MapboxSearchController = {
let locationProvider = PointLocationProvider(coordinate: .sanFrancisco)
var configuration = Configuration(locationProvider: locationProvider)
let formatter = MKDistanceFormatter()
formatter.unitStyle = .abbreviated
var configuration = Configuration(
locationProvider: locationProvider,
distanceFormatter: formatter
)

return MapboxSearchController(configuration: configuration)
}()
Expand Down
56 changes: 50 additions & 6 deletions MapboxSearch.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
048823492B6B0A9D00C770AA /* category-hotel-search-along-route-jp.json in Resources */ = {isa = PBXBuildFile; fileRef = 04AB0B7C2B6B043C00FDE7D5 /* category-hotel-search-along-route-jp.json */; };
0488234A2B6B0A9E00C770AA /* category-hotel-search-along-route-jp.json in Resources */ = {isa = PBXBuildFile; fileRef = 04AB0B7C2B6B043C00FDE7D5 /* category-hotel-search-along-route-jp.json */; };
04AB0B7B2B6AF43E00FDE7D5 /* DiscoverIntegrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04AB0B792B6AF37800FDE7D5 /* DiscoverIntegrationTests.swift */; };
04970F8D2B7A97C900213763 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 04970F8C2B7A97C900213763 /* PrivacyInfo.xcprivacy */; };
04AB0B4B2B6AADB700FDE7D5 /* mapbox.places.san.francisco.json in Resources */ = {isa = PBXBuildFile; fileRef = 04AB0B4A2B6AADB700FDE7D5 /* mapbox.places.san.francisco.json */; };
04AB0B4C2B6AADB700FDE7D5 /* mapbox.places.san.francisco.json in Resources */ = {isa = PBXBuildFile; fileRef = 04AB0B4A2B6AADB700FDE7D5 /* mapbox.places.san.francisco.json */; };
04AB0B4D2B6AADB700FDE7D5 /* mapbox.places.san.francisco.json in Resources */ = {isa = PBXBuildFile; fileRef = 04AB0B4A2B6AADB700FDE7D5 /* mapbox.places.san.francisco.json */; };
Expand All @@ -26,6 +27,8 @@
04C127582B62FFDB00884325 /* ApiType+Core.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04C127572B62FFDB00884325 /* ApiType+Core.swift */; };
04E5FF962B48828500DADC18 /* SearchAddressCountry.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E5FF952B48828500DADC18 /* SearchAddressCountry.swift */; };
04E5FF992B48829200DADC18 /* SearchAddressRegion.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E5FF982B48829200DADC18 /* SearchAddressRegion.swift */; };
04E84D122B76BA230056C269 /* Resources-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 04E84D112B76BA230056C269 /* Resources-Info.plist */; };
04E84D132B7A8F4D0056C269 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 04E84D072B7691610056C269 /* PrivacyInfo.xcprivacy */; };
140D1BDC286DB479001A51C2 /* SearchResultAccuracy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 140D1BDB286DB479001A51C2 /* SearchResultAccuracy.swift */; };
140E47A2298BC90E00677E30 /* Discover.swift in Sources */ = {isa = PBXBuildFile; fileRef = 140E47A1298BC90E00677E30 /* Discover.swift */; };
140E47A5298BC94D00677E30 /* Discover+Options.swift in Sources */ = {isa = PBXBuildFile; fileRef = 140E47A4298BC94D00677E30 /* Discover+Options.swift */; };
Expand All @@ -40,7 +43,6 @@
141789BB2878AD9B0000AE79 /* AddressAutofill.Options+Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 141789BA2878AD9B0000AE79 /* AddressAutofill.Options+Tests.swift */; };
141789E7287C05060000AE79 /* AddressAutofill.Suggestion+SearchResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = 141789E6287C05060000AE79 /* AddressAutofill.Suggestion+SearchResult.swift */; };
141789EE287C125E0000AE79 /* AddressAutofill.Suggestion+Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 141789E9287C115C0000AE79 /* AddressAutofill.Suggestion+Tests.swift */; };
1419EB6929670638009672CA /* Autofill.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1419EB6829670638009672CA /* Autofill.xcassets */; };
1420F31C29A2800300D4A511 /* CoreSearchResultStub+Samples.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1420F31729A25B5800D4A511 /* CoreSearchResultStub+Samples.swift */; };
1420F31D29A2800500D4A511 /* CoreSearchResultStub+Samples.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1420F31729A25B5800D4A511 /* CoreSearchResultStub+Samples.swift */; };
1421416A2953450C00774439 /* PlaceAutocomplete.swift in Sources */ = {isa = PBXBuildFile; fileRef = 142141692953450C00774439 /* PlaceAutocomplete.swift */; };
Expand Down Expand Up @@ -498,13 +500,23 @@
043A3D4C2B30F38300DB681B /* CoreAddress+AddressComponents.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CoreAddress+AddressComponents.swift"; sourceTree = "<group>"; };
04AB0B792B6AF37800FDE7D5 /* DiscoverIntegrationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DiscoverIntegrationTests.swift; sourceTree = "<group>"; };
04AB0B7C2B6B043C00FDE7D5 /* category-hotel-search-along-route-jp.json */ = {isa = PBXFileReference; explicitFileType = text.json; path = "category-hotel-search-along-route-jp.json"; sourceTree = "<group>"; };
04970F8C2B7A97C900213763 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
04AB0B4A2B6AADB700FDE7D5 /* mapbox.places.san.francisco.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = mapbox.places.san.francisco.json; sourceTree = "<group>"; };
04BBC6332B61898F00E24E99 /* LocalhostMockServiceProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalhostMockServiceProvider.swift; sourceTree = "<group>"; };
04C0848C2B4C82F3002F9C69 /* SdkInformation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SdkInformation.swift; sourceTree = "<group>"; };
04C127542B62F6BC00884325 /* ApiType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ApiType.swift; sourceTree = "<group>"; };
04C127572B62FFDB00884325 /* ApiType+Core.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ApiType+Core.swift"; sourceTree = "<group>"; };
04E5FF952B48828500DADC18 /* SearchAddressCountry.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SearchAddressCountry.swift; sourceTree = "<group>"; };
04E5FF982B48829200DADC18 /* SearchAddressRegion.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SearchAddressRegion.swift; sourceTree = "<group>"; };
04E84CFD2B768EDA0056C269 /* CHANGELOG.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = CHANGELOG.md; sourceTree = "<group>"; };
04E84CFE2B768EDA0056C269 /* Brewfile */ = {isa = PBXFileReference; lastKnownFileType = text; path = Brewfile; sourceTree = "<group>"; };
04E84D012B768F210056C269 /* Pluginfile */ = {isa = PBXFileReference; lastKnownFileType = text; path = Pluginfile; sourceTree = "<group>"; };
04E84D022B768F210056C269 /* Appfile */ = {isa = PBXFileReference; lastKnownFileType = text; path = Appfile; sourceTree = "<group>"; };
04E84D032B768F210056C269 /* Fastfile */ = {isa = PBXFileReference; lastKnownFileType = text; path = Fastfile; sourceTree = "<group>"; };
04E84D042B768F210056C269 /* .env */ = {isa = PBXFileReference; lastKnownFileType = text; path = .env; sourceTree = "<group>"; };
04E84D052B768F210056C269 /* Matchfile */ = {isa = PBXFileReference; lastKnownFileType = text; path = Matchfile; sourceTree = "<group>"; };
04E84D072B7691610056C269 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
04E84D112B76BA230056C269 /* Resources-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Resources-Info.plist"; sourceTree = "<group>"; };
140D1BDB286DB479001A51C2 /* SearchResultAccuracy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchResultAccuracy.swift; sourceTree = "<group>"; };
140E47A1298BC90E00677E30 /* Discover.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Discover.swift; sourceTree = "<group>"; };
140E47A4298BC94D00677E30 /* Discover+Options.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Discover+Options.swift"; sourceTree = "<group>"; };
Expand All @@ -519,7 +531,6 @@
141789BA2878AD9B0000AE79 /* AddressAutofill.Options+Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "AddressAutofill.Options+Tests.swift"; sourceTree = "<group>"; };
141789E6287C05060000AE79 /* AddressAutofill.Suggestion+SearchResult.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "AddressAutofill.Suggestion+SearchResult.swift"; sourceTree = "<group>"; };
141789E9287C115C0000AE79 /* AddressAutofill.Suggestion+Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "AddressAutofill.Suggestion+Tests.swift"; sourceTree = "<group>"; };
1419EB6829670638009672CA /* Autofill.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Autofill.xcassets; sourceTree = "<group>"; };
1420F31729A25B5800D4A511 /* CoreSearchResultStub+Samples.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "CoreSearchResultStub+Samples.swift"; sourceTree = "<group>"; };
142141692953450C00774439 /* PlaceAutocomplete.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlaceAutocomplete.swift; sourceTree = "<group>"; };
143695F5289927FD00861F1A /* UIApplication+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIApplication+Extensions.swift"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -652,7 +663,6 @@
FE114D8824C1A86A001B2CE8 /* .gitignore */ = {isa = PBXFileReference; lastKnownFileType = text; path = .gitignore; sourceTree = "<group>"; };
FE114D8924C1A86A001B2CE8 /* .swiftlint.yml */ = {isa = PBXFileReference; lastKnownFileType = text.yaml; path = .swiftlint.yml; sourceTree = "<group>"; };
FE114D8A24C1A86A001B2CE8 /* .swiftformat */ = {isa = PBXFileReference; lastKnownFileType = text; path = .swiftformat; sourceTree = "<group>"; };
FE114D8B24C1A86A001B2CE8 /* .travis.yml */ = {isa = PBXFileReference; lastKnownFileType = text.yaml; path = .travis.yml; sourceTree = "<group>"; };
FE114D8C24C1A873001B2CE8 /* MapboxSearchUI.podspec */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; path = MapboxSearchUI.podspec; sourceTree = "<group>"; };
FE114D8D24C1A873001B2CE8 /* MapboxSearch.podspec */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; path = MapboxSearch.podspec; sourceTree = "<group>"; };
FE114D8E24C1A880001B2CE8 /* Gemfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; path = Gemfile; sourceTree = "<group>"; };
Expand Down Expand Up @@ -918,6 +928,14 @@
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
04970F8B2B7A97C900213763 /* Resources */ = {
isa = PBXGroup;
children = (
04970F8C2B7A97C900213763 /* PrivacyInfo.xcprivacy */,
);
path = Resources;
sourceTree = "<group>";
};
04C127562B62FFD000884325 /* Engine */ = {
isa = PBXGroup;
children = (
Expand All @@ -934,6 +952,26 @@
path = Region;
sourceTree = "<group>";
};
04E84D002B768F210056C269 /* .fastlane */ = {
isa = PBXGroup;
children = (
04E84D012B768F210056C269 /* Pluginfile */,
04E84D022B768F210056C269 /* Appfile */,
04E84D032B768F210056C269 /* Fastfile */,
04E84D042B768F210056C269 /* .env */,
04E84D052B768F210056C269 /* Matchfile */,
);
path = .fastlane;
sourceTree = "<group>";
};
04E84D062B7691420056C269 /* Resources */ = {
isa = PBXGroup;
children = (
04E84D072B7691610056C269 /* PrivacyInfo.xcprivacy */,
);
path = Resources;
sourceTree = "<group>";
};
140E47A0298BC8F800677E30 /* Discover API */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -1071,7 +1109,6 @@
1419EB6729670629009672CA /* Resources */ = {
isa = PBXGroup;
children = (
1419EB6829670638009672CA /* Autofill.xcassets */,
);
name = Resources;
sourceTree = "<group>";
Expand Down Expand Up @@ -1510,12 +1547,14 @@
FE114D8524C1A857001B2CE8 /* Metadata */ = {
isa = PBXGroup;
children = (
04E84D002B768F210056C269 /* .fastlane */,
04E84CFE2B768EDA0056C269 /* Brewfile */,
04E84CFD2B768EDA0056C269 /* CHANGELOG.md */,
FE529611253704F900F61A0F /* .circleci */,
FE114D8824C1A86A001B2CE8 /* .gitignore */,
FE114D8624C1A86A001B2CE8 /* .swift-version */,
FE114D8A24C1A86A001B2CE8 /* .swiftformat */,
FE114D8924C1A86A001B2CE8 /* .swiftlint.yml */,
FE114D8B24C1A86A001B2CE8 /* .travis.yml */,
FE114D8724C1A86A001B2CE8 /* Cartfile */,
FE114D8F24C1A880001B2CE8 /* CODEOWNERS */,
FE114D8E24C1A880001B2CE8 /* Gemfile */,
Expand Down Expand Up @@ -1573,6 +1612,7 @@
FEEDD2C02508DFE400DC0A98 /* MapboxSearch */ = {
isa = PBXGroup;
children = (
04E84D062B7691420056C269 /* Resources */,
FEEDD2C12508DFE400DC0A98 /* InternalAPI */,
FEEDD2D42508DFE400DC0A98 /* PublicAPI */,
);
Expand Down Expand Up @@ -1674,6 +1714,8 @@
FEEDD31E2508E02700DC0A98 /* MapboxSearchUI */ = {
isa = PBXGroup;
children = (
04E84D112B76BA230056C269 /* Resources-Info.plist */,
04970F8B2B7A97C900213763 /* Resources */,
FEEDD34E2508E02700DC0A98 /* ActivityProgressView.swift */,
FEEDD33F2508E02700DC0A98 /* ActivityProgressView.xib */,
FE4F260525F8E8B700454BC5 /* AddToFavoritesCell.swift */,
Expand Down Expand Up @@ -2053,7 +2095,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
1419EB6929670638009672CA /* Autofill.xcassets in Resources */,
04E84D132B7A8F4D0056C269 /* PrivacyInfo.xcprivacy in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -2178,6 +2220,8 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
04E84D122B76BA230056C269 /* Resources-Info.plist in Resources */,
04970F8D2B7A97C900213763 /* PrivacyInfo.xcprivacy in Resources */,
FEC6EEE5246BFBB30051732D /* MapboxSearchUIResources.bundle in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
8 changes: 7 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,18 @@ let package = Package(
"MapboxCommon",
],
exclude: ["Info.plist"],
resources: [
.copy("Resources/PrivacyInfo.xcprivacy"),
],
linkerSettings: [.linkedLibrary("c++")]
),
.target(
name: "MapboxSearchUI",
dependencies: ["MapboxSearch"],
exclude: ["Info.plist", "Resources-Info.plist"]
exclude: ["Info.plist", "Resources-Info.plist"],
resources: [
.copy("Resources/PrivacyInfo.xcprivacy"),
]
),

coreSearchTarget(
Expand Down
6 changes: 0 additions & 6 deletions Sources/Demo/Autofill.xcassets/Contents.json

This file was deleted.

21 changes: 0 additions & 21 deletions Sources/Demo/Autofill.xcassets/pin.imageset/Contents.json

This file was deleted.

Binary file not shown.
4 changes: 2 additions & 2 deletions Sources/Demo/PlaceAutocompleteDetailsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ extension PlaceAutocompleteResultViewController {
}

extension PlaceAutocomplete.Result {
static let measurumentFormatter: MeasurementFormatter = {
static let measurementFormatter: MeasurementFormatter = {
let formatter = MeasurementFormatter()
formatter.unitOptions = [.naturalScale]
formatter.numberFormatter.roundingMode = .halfUp
Expand Down Expand Up @@ -137,7 +137,7 @@ extension PlaceAutocomplete.Result {
components.append(
(
name: "Estimated time",
value: PlaceAutocomplete.Result.measurumentFormatter.string(from: estimatedTime)
value: PlaceAutocomplete.Result.measurementFormatter.string(from: estimatedTime)
)
)
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/Demo/PlaceAutocompleteMainViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ extension PlaceAutocompleteMainViewController: UITableViewDataSource, UITableVie
description += "\n\(PlaceAutocomplete.Result.distanceFormatter.string(fromDistance: distance))"
}
if let estimatedTime = suggestion.estimatedTime {
description += "\n\(PlaceAutocomplete.Result.measurumentFormatter.string(from: estimatedTime))"
description += "\n\(PlaceAutocomplete.Result.measurementFormatter.string(from: estimatedTime))"
}

tableViewCell.detailTextLabel?.text = description
Expand Down
Loading

0 comments on commit 807ac1b

Please sign in to comment.