@@ -24,13 +24,6 @@ public class TKRouter: NSObject {
2424 /// Optional parameters to add to routing query. Only used by TripKit.
2525 public static var defaultParameters : [ URLQueryItem ] ? = nil
2626
27- /// Optional setting to group certain modes always in a single `routing.json` when sending a
28- /// multi-fetch request.
29- ///
30- /// If you're using `TKUIRoutingResultsCard`, prefer
31- /// `TKUIRoutingResultsCard.config.routingModeRequestGroupAdjuster`.
32- public static var modesToGroupInRequest : [ String ] ? = nil
33-
3427 /// Optional server to use instead of ``TKServer/shared``.
3528 public var server : TKServer ?
3629
@@ -104,8 +97,7 @@ extension TKRouter {
10497 } else {
10598 let groupedIdentifier = TKTransportMode . groupModeIdentifiers (
10699 request. modes,
107- includeGroupForAll: true ,
108- alwaysGroupedModeIdentifierPrefixes: TKRouter . modesToGroupInRequest ?? [ ]
100+ includeGroupForAll: true
109101 )
110102 guard !groupedIdentifier. isEmpty else {
111103 throw RoutingError . invalidRequest ( " No modes enabled " )
@@ -265,11 +257,9 @@ extension TKTransportMode {
265257 /// - modes: A set of all the identifiers to be grouped
266258 /// - includeGroupForAll: If an extra group which has all the identifiers should be added
267259 /// - Returns: A set of a set of mode identifiers
268- public static func groupModeIdentifiers( _ modes: Set < String > , includeGroupForAll: Bool , alwaysGroupedModeIdentifierPrefixes: [ String ] = [ ] ) -> Set < Set < String > > {
269- let identifiersToAlwaysGroup = alwaysGroupedModeIdentifierPrefixes
260+ public static func groupModeIdentifiers( _ modes: Set < String > , includeGroupForAll: Bool ) -> Set < Set < String > > {
270261 var result : Set < Set < String > > = [ ]
271262 var processedModes : Set < String > = [ ]
272- var specialGroups : [ String : Set < String > ] = [ : ]
273263 var includesWalkOnly = false
274264
275265 for mode in modes {
@@ -279,10 +269,6 @@ extension TKTransportMode {
279269 continue // don't add flights by themselves
280270 } else if mode == TKTransportMode . walking. modeIdentifier || mode == TKTransportMode . wheelchair. modeIdentifier {
281271 includesWalkOnly = true
282- } else if let forceGroup = identifiersToAlwaysGroup. first ( where: { mode. hasPrefix ( $0) } ) {
283- specialGroups [ forceGroup, default: [ ] ] . insert ( mode)
284- processedModes. insert ( mode)
285- continue
286272 }
287273
288274 var group : Set < String > = [ mode]
@@ -306,10 +292,6 @@ extension TKTransportMode {
306292 processedModes. formUnion ( group)
307293 }
308294
309- for specials in specialGroups. values {
310- result. insert ( specials)
311- }
312-
313295 if includeGroupForAll, result. count > 1 + ( includesWalkOnly ? 1 : 0 ) {
314296 result. insert ( modes)
315297 }
0 commit comments