Skip to content

Commit

Permalink
Update MapboxCommon v24.6.0-beta.1, MapboxCoreSearch v2.3.0-rc.3 (#276)
Browse files Browse the repository at this point in the history
### Description

Fixes SSDK-935

- Update project dependencies:
    **MapboxCommon**: v24.5.0
    **MapboxCoreSearch**: v2.3.0-rc.1
- Update changelog with some earlier work
- Add new fields and types
  • Loading branch information
aokj4ck authored Jul 26, 2024
1 parent 538db98 commit cf82236
Show file tree
Hide file tree
Showing 13 changed files with 269 additions and 28 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,14 @@ Guide: https://keepachangelog.com/en/1.0.0/

<!-- Add changes for active work here -->

- [Demo] Update Demo app to use MapboxMaps
- [Demo] Rename 'Discover' tab to 'Category' in Demo app target
- [Demo] Add earlier examples into MapboxSearch.xcodeproj Demo target
- [SearchUI] Add `Maki: RawRepresentable` conformance for `Maki(rawValue:)` initializer
- [Demo] Update DiscoverViewController to use MapboxMaps
- [Core] Add public scope to several types and initializers for broader support

**MapboxCommon**: v24.5.0
**MapboxCoreSearch**: v2.3.0-rc.1

## 2.2.0

Expand Down
4 changes: 2 additions & 2 deletions Cartfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
binary "https://api.mapbox.com/downloads/v2/carthage/search-core-sdk/MapboxCoreSearch.xcframework.json" == 2.2.0
binary "https://api.mapbox.com/downloads/v2/carthage/mapbox-common/MapboxCommon.json" == 24.5.0
binary "https://api.mapbox.com/downloads/v2/carthage/search-core-sdk/MapboxCoreSearch.xcframework.json" == 2.3.0-rc.3
binary "https://api.mapbox.com/downloads/v2/carthage/mapbox-common/MapboxCommon.json" == 24.6.0-beta.1
4 changes: 2 additions & 2 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
binary "https://api.mapbox.com/downloads/v2/carthage/mapbox-common/MapboxCommon.json" "24.5.0"
binary "https://api.mapbox.com/downloads/v2/carthage/search-core-sdk/MapboxCoreSearch.xcframework.json" "2.2.0"
binary "https://api.mapbox.com/downloads/v2/carthage/mapbox-common/MapboxCommon.json" "24.6.0-beta.1"
binary "https://api.mapbox.com/downloads/v2/carthage/search-core-sdk/MapboxCoreSearch.xcframework.json" "2.3.0-rc.3"
8 changes: 4 additions & 4 deletions MapboxSearch.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
04C0848D2B4C82F3002F9C69 /* SdkInformation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04C0848C2B4C82F3002F9C69 /* SdkInformation.swift */; };
04C127552B62F6BC00884325 /* ApiType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04C127542B62F6BC00884325 /* ApiType.swift */; };
04C127582B62FFDB00884325 /* ApiType+Core.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04C127572B62FFDB00884325 /* ApiType+Core.swift */; };
04CECA012C3EE28B007117E4 /* ResultDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04CECA002C3EE28B007117E4 /* ResultDetailViewController.swift */; };
04CECA092C3EFAAF007117E4 /* MapboxMapsCategoryResultsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04CECA032C3EFAAF007117E4 /* MapboxMapsCategoryResultsViewController.swift */; };
04CECA0A2C3EFAAF007117E4 /* SimpleCategorySearchViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04CECA042C3EFAAF007117E4 /* SimpleCategorySearchViewController.swift */; };
04CECA0B2C3EFAAF007117E4 /* ContinuousSearchViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04CECA052C3EFAAF007117E4 /* ContinuousSearchViewController.swift */; };
Expand All @@ -60,7 +61,6 @@
04CECA142C3EFAB9007117E4 /* MapsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04CECA102C3EFAB9007117E4 /* MapsViewController.swift */; };
04CECA152C3EFAB9007117E4 /* TextViewLoggerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04CECA112C3EFAB9007117E4 /* TextViewLoggerViewController.swift */; };
04CECA162C3EFAB9007117E4 /* ExamplesTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04CECA122C3EFAB9007117E4 /* ExamplesTableViewController.swift */; };
04CECA012C3EE28B007117E4 /* ResultDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04CECA002C3EE28B007117E4 /* ResultDetailViewController.swift */; };
04DAF7582BDAAB4C002719E2 /* OfflineDemoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04DAF7572BDAAB4C002719E2 /* OfflineDemoViewController.swift */; };
04DFB40C2B8CF1ED00231830 /* search-box-suggestions-categories.json in Resources */ = {isa = PBXBuildFile; fileRef = 04DFB40B2B8CF1ED00231830 /* search-box-suggestions-categories.json */; };
04DFB40D2B8CF1ED00231830 /* search-box-suggestions-categories.json in Resources */ = {isa = PBXBuildFile; fileRef = 04DFB40B2B8CF1ED00231830 /* search-box-suggestions-categories.json */; };
Expand Down Expand Up @@ -561,6 +561,7 @@
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>"; };
04CECA002C3EE28B007117E4 /* ResultDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ResultDetailViewController.swift; sourceTree = "<group>"; };
04CECA032C3EFAAF007117E4 /* MapboxMapsCategoryResultsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = MapboxMapsCategoryResultsViewController.swift; path = Sources/Demo/Examples/MapboxMapsCategoryResultsViewController.swift; sourceTree = SOURCE_ROOT; };
04CECA042C3EFAAF007117E4 /* SimpleCategorySearchViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SimpleCategorySearchViewController.swift; path = Sources/Demo/Examples/SimpleCategorySearchViewController.swift; sourceTree = SOURCE_ROOT; };
04CECA052C3EFAAF007117E4 /* ContinuousSearchViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ContinuousSearchViewController.swift; path = Sources/Demo/Examples/ContinuousSearchViewController.swift; sourceTree = SOURCE_ROOT; };
Expand All @@ -571,7 +572,6 @@
04CECA102C3EFAB9007117E4 /* MapsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = MapsViewController.swift; path = Sources/Demo/Examples/MapsViewController.swift; sourceTree = SOURCE_ROOT; };
04CECA112C3EFAB9007117E4 /* TextViewLoggerViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TextViewLoggerViewController.swift; path = Sources/Demo/Examples/TextViewLoggerViewController.swift; sourceTree = SOURCE_ROOT; };
04CECA122C3EFAB9007117E4 /* ExamplesTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ExamplesTableViewController.swift; path = Sources/Demo/Examples/ExamplesTableViewController.swift; sourceTree = SOURCE_ROOT; };
04CECA002C3EE28B007117E4 /* ResultDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ResultDetailViewController.swift; sourceTree = "<group>"; };
04DAF7572BDAAB4C002719E2 /* OfflineDemoViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OfflineDemoViewController.swift; sourceTree = "<group>"; };
04DFB40B2B8CF1ED00231830 /* search-box-suggestions-categories.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = "search-box-suggestions-categories.json"; sourceTree = "<group>"; };
04DFB40F2B8CF46D00231830 /* search-box-retrieve-categories.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = "search-box-retrieve-categories.json"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -3604,15 +3604,15 @@
repositoryURL = "https://github.com/mapbox/mapbox-common-ios.git";
requirement = {
kind = exactVersion;
version = 24.5.0;
version = "24.6.0-beta.1";
};
};
042BEB182C2DE30E0004CD7B /* XCRemoteSwiftPackageReference "mapbox-maps-ios" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/mapbox/mapbox-maps-ios.git";
requirement = {
kind = exactVersion;
version = 11.5.0;
version = "11.6.0-beta.1";
};
};
149948E5290A8ACE00E7E619 /* XCRemoteSwiftPackageReference "swifter" */ = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,26 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/mapbox/mapbox-common-ios.git",
"state" : {
"revision" : "add54e4b7d4cfe1e12600d73af6d38a536b37085",
"version" : "24.5.0"
"revision" : "03c1b2ee8d57d1fa95af7c472c9707cb897b2376",
"version" : "24.6.0-beta.1"
}
},
{
"identity" : "mapbox-core-maps-ios",
"kind" : "remoteSourceControl",
"location" : "https://github.com/mapbox/mapbox-core-maps-ios.git",
"state" : {
"revision" : "5d5d126c7a0f743b05c8889437e788fdd2356308",
"version" : "11.5.0"
"revision" : "86992e7b2604282fc10680e524a2a67a4586df05",
"version" : "11.6.0-beta.1"
}
},
{
"identity" : "mapbox-maps-ios",
"kind" : "remoteSourceControl",
"location" : "https://github.com/mapbox/mapbox-maps-ios.git",
"state" : {
"revision" : "692d783e92077d34af0a766b57cd4c85e341db61",
"version" : "11.5.0"
"revision" : "86476e9828bb3a61527a00f767d45a19f93219f5",
"version" : "11.6.0-beta.1"
}
},
{
Expand Down
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import PackageDescription
import Foundation

let (coreSearchVersion, coreSearchVersionHash) = ("2.2.0", "350fb52d0bc1caf60e14270aa603aab1f4f2ae7a907eddf24e1b700fbd709f6d")
let (coreSearchVersion, coreSearchVersionHash) = ("2.3.0-rc.3", "409ad69ede360cd97fe54470aa3bf4aeae07ec452beda838fbc9cca0227f6fd5")

let mapboxCommonSDKVersion = Version("24.5.0")
let mapboxCommonSDKVersion = Version("24.6.0-beta.1")

let package = Package(
name: "MapboxSearch",
Expand Down
2 changes: 2 additions & 0 deletions Sources/MapboxSearch/InternalAPI/CoreAliases.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ typealias CoreQueryType = MapboxCoreSearch.QueryType
typealias CoreImageInfo = MapboxCoreSearch.ImageInfo
typealias CoreOpenHours = MapboxCoreSearch.OpenHours
typealias CoreOpenPeriod = MapboxCoreSearch.OpenPeriod
typealias CoreParkingData = MapboxCoreSearch.ParkingData
typealias CoreResultChildMetadata = MapboxCoreSearch.ResultChildMetadata
typealias CoreAccuracy = MapboxCoreSearch.ResultAccuracy
typealias CoreSearchAddressRegion = MapboxCoreSearch.SearchAddressRegion
typealias CoreSearchAddressCountry = MapboxCoreSearch.SearchAddressCountry
Expand Down
163 changes: 163 additions & 0 deletions Sources/MapboxSearch/InternalAPI/CoreResultMetadataProtocol.swift
Original file line number Diff line number Diff line change
@@ -1,20 +1,113 @@
import Foundation

protocol CoreResultMetadataProtocol {
// MARK: Basic metadata

/** Dictionary with other metadata like "iso\_3166\_1" and "iso\_3166\_2" codes. */
var data: [String: String] { get }

/** Child metadata for a POI */
var children: [CoreResultChildMetadata]? { get }

/** Primary photos array. */
var primaryImage: [CoreImageInfoProtocol]? { get }

/** Secondary photos array. */
var otherImage: [CoreImageInfoProtocol]? { get }

/** Long form detailed description for POI. */
var description: String? { get }

/** The average rating of the location, on a scale from 1 to 5. */
var averageRating: NSNumber? { get }

/** The number of reviews for this result. */
var reviewCount: NSNumber? { get }

/** Phone number. */
var phone: String? { get }

/** The website URL associated with the location. */
var website: String? { get }

// MARK: Characteristics and Options

/** The price level of the location, represented by a string including dollar signs. The values scale from Cheap "$" to Most Expensive "$$$$". */
var priceLevel: String? { get }

/** A popularity score for the location, calculated based on user engagement and review counts. The value scales from 0 to 1, 1 being the most popular. */
var popularity: NSNumber? { get }

/** POI open hours */
var openHours: CoreOpenHours? { get }

/** Parking information for POIs. */
var parkingData: CoreParkingData? { get }

/** Indicates whether the location is accessible by wheelchair. */
var wheelchairAccessible: Bool? { get }

/** Indicates whether the location offers delivery services. */
var delivery: Bool? { get }

/** Indicates whether the location has a drive-through service. */
var driveThrough: Bool? { get }

/** Indicates whether the location accepts reservations. */
var reservable: Bool? { get }

/** Indicates whether parking is available at the location. */
var parkingAvailable: Bool? { get }

/** Indicates whether valet parking services are offered. */
var valetParking: Bool? { get }

/** Indicates the availability of street parking near the location. */
var streetParking: Bool? { get }

/** Indicates whether breakfast is served. */
var servesBreakfast: Bool? { get }

/** Indicates whether brunch is served. */
var servesBrunch: Bool? { get }

/** Indicates whether dinner is served. */
var servesDinner: Bool? { get }

/** Indicates whether lunch is served. */
var servesLunch: Bool? { get }

/** Indicates whether wine is served. */
var servesWine: Bool? { get }

/** Indicates whether beer is served. */
var servesBeer: Bool? { get }

/** Indicates whether vegan diet options are available. */
var servesVegan: Bool? { get }

/** Indicates whether vegetarian diet options are available. */
var servesVegetarian: Bool? { get }

/** Indicates whether takeout services are available. */
var takeout: Bool? { get }

// MARK: Social Media and Contact

/** The Facebook ID associated with the feature. */
var facebookId: String? { get }

/** The fax number associated with the location. */
var fax: String? { get }

/** The email address associated with the location. */
var email: String? { get }

/** The Instagram handle associated with the location. */
var instagram: String? { get }

/** The Twitter handle associated with the location. */
var twitter: String? { get }
}

extension CoreResultMetadata: CoreResultMetadataProtocol {
Expand All @@ -29,4 +122,74 @@ extension CoreResultMetadata: CoreResultMetadataProtocol {
var averageRating: NSNumber? {
avRating
}

var parkingData: CoreParkingData? {
parking
}

// MARK: Characteristics and Options Implementation

var wheelchairAccessible: Bool? {
__wheelchairAccessible?.boolValue
}

var delivery: Bool? {
__delivery?.boolValue
}

var driveThrough: Bool? {
__driveThrough?.boolValue
}

var reservable: Bool? {
__reservable?.boolValue
}

var parkingAvailable: Bool? {
__parkingAvailable?.boolValue
}

var valetParking: Bool? {
__valetParking?.boolValue
}

var streetParking: Bool? {
__streetParking?.boolValue
}

var servesBreakfast: Bool? {
__servesBreakfast?.boolValue
}

var servesBrunch: Bool? {
__servesBrunch?.boolValue
}

var servesDinner: Bool? {
__servesDinner?.boolValue
}

var servesLunch: Bool? {
__servesLunch?.boolValue
}

var servesWine: Bool? {
__servesWine?.boolValue
}

var servesBeer: Bool? {
__servesBeer?.boolValue
}

var servesVegan: Bool? {
__servesVegan?.boolValue
}

var servesVegetarian: Bool? {
__servesVegetarian?.boolValue
}

var takeout: Bool? {
__takeout?.boolValue
}
}
5 changes: 4 additions & 1 deletion Sources/MapboxSearch/PublicAPI/SearchOptions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,10 @@ public struct SearchOptions {
route: routeOptions?.route.coordinates.map(Coordinate2D.init(value:)),
sarType: routeOptions?.deviation.sarType?.toCore(),
timeDeviation: timeDeviation,
addonAPI: unsafeParameters
addonAPI: unsafeParameters,
attributeSets: nil,
worldview: nil,
baseUrl: nil
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ extension CoreSearchOptions {
],
sarType: "isochrone",
timeDeviation: 10,
addonAPI: nil
addonAPI: nil,
attributeSets: nil,
worldview: nil,
baseUrl: nil
)

static let sample2 = CoreSearchOptions(
Expand Down Expand Up @@ -66,6 +69,9 @@ extension CoreSearchOptions {
],
sarType: "isochrone",
timeDeviation: 10,
addonAPI: nil
addonAPI: nil,
attributeSets: nil,
worldview: nil,
baseUrl: nil
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ extension SearchResultMetadata {

extension CoreResultMetadata {
static func make(data: [String: String] = [:]) -> CoreResultMetadata {
.init(
CoreResultMetadata(
reviewCount: nil,
phone: nil,
website: nil,
Expand All @@ -37,7 +37,32 @@ extension CoreResultMetadata {
otherPhoto: nil,
cpsJson: nil,
parking: nil,
data: data
children: nil,
data: data,
wheelchairAccessible: nil,
delivery: nil,
driveThrough: nil,
reservable: nil,
parkingAvailable: nil,
valetParking: nil,
streetParking: nil,
servesBreakfast: nil,
servesBrunch: nil,
servesDinner: nil,
servesLunch: nil,
servesWine: nil,
servesBeer: nil,
takeout: nil,
facebookId: nil,
fax: nil,
email: nil,
instagram: nil,
twitter: nil,
priceLevel: nil,
servesVegan: nil,
servesVegetarian: nil,
rating: nil,
popularity: nil
)
}
}
Loading

0 comments on commit cf82236

Please sign in to comment.