Skip to content

Commit 08002d5

Browse files
evil159github-actions[bot]
authored andcommitted
Add pin powered map use case (#6649)
This PR adds pin powered map use case + updates UI for the examples app. <img width="300" alt="Simulator Screenshot - iPhone 17 Pro - 2025-09-18 at 16 51 12" src="https://github.com/user-attachments/assets/ad01711d-d9c8-4c70-a620-5ce8709e4dd4" /> cc @mapbox/maps-ios GitOrigin-RevId: 616736d3aae1903a0013d39a8ccb72e364f72b9d
1 parent a150a75 commit 08002d5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1921
-58
lines changed

Examples.xcodeproj/project.pbxproj

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,21 @@
8282
7350DF212DFCC73A00B47542 /* MarkersExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7350DF1E2DFCC73A00B47542 /* MarkersExample.swift */; };
8383
7352DDB22DD7E9EE000E3000 /* StudioStyleExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7352DDB02DD7E9EE000E3000 /* StudioStyleExample.swift */; };
8484
7365170E39A459EB4DFA198B /* ExamplesUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = BE18E37A8652B4807D2459F1 /* ExamplesUITests.swift */; platformFilter = ios; };
85+
74C285362E7D4B0100A4A5B8 /* ExamplesRootView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74C285352E7D4B0100A4A5B8 /* ExamplesRootView.swift */; };
86+
74C285502E7D4B1800A4A5B8 /* style.json in Resources */ = {isa = PBXBuildFile; fileRef = 74C285462E7D4B1800A4A5B8 /* style.json */; };
87+
74C285512E7D4B1800A4A5B8 /* VisitManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74C2853F2E7D4B1800A4A5B8 /* VisitManager.swift */; };
88+
74C285522E7D4B1800A4A5B8 /* PinPoweredMapConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74C285382E7D4B1800A4A5B8 /* PinPoweredMapConstants.swift */; };
89+
74C285562E7D4B1800A4A5B8 /* POICategory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74C2853E2E7D4B1800A4A5B8 /* POICategory.swift */; };
90+
74C285582E7D4B1800A4A5B8 /* FeatureDetails.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74C2853B2E7D4B1800A4A5B8 /* FeatureDetails.swift */; };
91+
74C285592E7D4B1800A4A5B8 /* FavoritesManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74C2853A2E7D4B1800A4A5B8 /* FavoritesManager.swift */; };
92+
74C2855A2E7D4B1800A4A5B8 /* FilterView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74C285432E7D4B1800A4A5B8 /* FilterView.swift */; };
93+
74C2855B2E7D4B1800A4A5B8 /* SegmentedToggleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74C285442E7D4B1800A4A5B8 /* SegmentedToggleView.swift */; };
94+
74C2855C2E7D4B1800A4A5B8 /* OpenHours+Formatting.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74C2853D2E7D4B1800A4A5B8 /* OpenHours+Formatting.swift */; };
95+
74C2855D2E7D4B1800A4A5B8 /* DetailsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74C285422E7D4B1800A4A5B8 /* DetailsView.swift */; };
96+
74C2855E2E7D4B1800A4A5B8 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74C285372E7D4B1800A4A5B8 /* Extensions.swift */; };
97+
74C2855F2E7D4B1800A4A5B8 /* NetworkService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74C2853C2E7D4B1800A4A5B8 /* NetworkService.swift */; };
98+
74C285602E7D4B1800A4A5B8 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74C285412E7D4B1800A4A5B8 /* ContentView.swift */; };
99+
74C285622E7D4B1800A4A5B8 /* UseCasesRoot.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74C2854E2E7D4B1800A4A5B8 /* UseCasesRoot.swift */; };
85100
759D42AA5FE93B6FA9DFADF5 /* LocationOverrideExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45B39AE24486FED5ED30392D /* LocationOverrideExample.swift */; };
86101
7686448F8648BECC75A912B6 /* DashboardCarPlaySceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 913B4773A82AD6357D6AAEA1 /* DashboardCarPlaySceneDelegate.swift */; platformFilter = ios; };
87102
79843B780E7C5DC68433B745 /* SnapshotMapExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC5A8729C9AEA4711B56B5F0 /* SnapshotMapExample.swift */; };
@@ -260,6 +275,21 @@
260275
7350DF1E2DFCC73A00B47542 /* MarkersExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MarkersExample.swift; sourceTree = "<group>"; };
261276
7352DDB02DD7E9EE000E3000 /* StudioStyleExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StudioStyleExample.swift; sourceTree = "<group>"; };
262277
7352DDB42DDB93B5000E3000 /* StudioStyleExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = StudioStyleExample.swift; path = "Sources/Examples/SwiftUI Examples/Testing Examples/StudioStyleExample.swift"; sourceTree = "<group>"; };
278+
74C285352E7D4B0100A4A5B8 /* ExamplesRootView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExamplesRootView.swift; sourceTree = "<group>"; };
279+
74C285372E7D4B1800A4A5B8 /* Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = "<group>"; };
280+
74C285382E7D4B1800A4A5B8 /* PinPoweredMapConstants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PinPoweredMapConstants.swift; sourceTree = "<group>"; };
281+
74C2853A2E7D4B1800A4A5B8 /* FavoritesManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FavoritesManager.swift; sourceTree = "<group>"; };
282+
74C2853B2E7D4B1800A4A5B8 /* FeatureDetails.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeatureDetails.swift; sourceTree = "<group>"; };
283+
74C2853C2E7D4B1800A4A5B8 /* NetworkService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkService.swift; sourceTree = "<group>"; };
284+
74C2853D2E7D4B1800A4A5B8 /* OpenHours+Formatting.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "OpenHours+Formatting.swift"; sourceTree = "<group>"; };
285+
74C2853E2E7D4B1800A4A5B8 /* POICategory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = POICategory.swift; sourceTree = "<group>"; };
286+
74C2853F2E7D4B1800A4A5B8 /* VisitManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VisitManager.swift; sourceTree = "<group>"; };
287+
74C285412E7D4B1800A4A5B8 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
288+
74C285422E7D4B1800A4A5B8 /* DetailsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DetailsView.swift; sourceTree = "<group>"; };
289+
74C285432E7D4B1800A4A5B8 /* FilterView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FilterView.swift; sourceTree = "<group>"; };
290+
74C285442E7D4B1800A4A5B8 /* SegmentedToggleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SegmentedToggleView.swift; sourceTree = "<group>"; };
291+
74C285462E7D4B1800A4A5B8 /* style.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = style.json; sourceTree = "<group>"; };
292+
74C2854E2E7D4B1800A4A5B8 /* UseCasesRoot.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UseCasesRoot.swift; sourceTree = "<group>"; };
263293
75D03F5A3A0E879717BFE421 /* Constants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Constants.swift; sourceTree = "<group>"; };
264294
7613C4E19DCD679A2620223C /* GeofencingPlayground.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GeofencingPlayground.swift; sourceTree = "<group>"; };
265295
78811E5A3185D2D32495870A /* SimpleMapExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SimpleMapExample.swift; sourceTree = "<group>"; };
@@ -402,11 +432,13 @@
402432
EC1155178B21E2E8075454A8 /* Info.plist */,
403433
55FDF5B3329BFD6E6C346D80 /* LaunchScreen.storyboard */,
404434
96B0E9086FE939F5D723136D /* VisionOSMain.swift */,
435+
74C285352E7D4B0100A4A5B8 /* ExamplesRootView.swift */,
405436
ACB753539ABAD3312B849CB1 /* All Examples */,
406437
43EC579EBDA110D1E1B3E494 /* Controllers */,
407438
9AC6F30FB33614908581AE8E /* Extensions */,
408439
846FF5BF97AEEAC876994DF3 /* Models */,
409440
55E0EEEC0D91AF2DFDCD9A33 /* SwiftUI Examples */,
441+
74C2854F2E7D4B1800A4A5B8 /* UseCases */,
410442
);
411443
name = Examples;
412444
path = Sources/Examples;
@@ -458,6 +490,59 @@
458490
path = Util;
459491
sourceTree = "<group>";
460492
};
493+
74C285392E7D4B1800A4A5B8 /* Misc */ = {
494+
isa = PBXGroup;
495+
children = (
496+
74C285372E7D4B1800A4A5B8 /* Extensions.swift */,
497+
74C285382E7D4B1800A4A5B8 /* PinPoweredMapConstants.swift */,
498+
);
499+
path = Misc;
500+
sourceTree = "<group>";
501+
};
502+
74C285402E7D4B1800A4A5B8 /* Models */ = {
503+
isa = PBXGroup;
504+
children = (
505+
74C2853A2E7D4B1800A4A5B8 /* FavoritesManager.swift */,
506+
74C2853B2E7D4B1800A4A5B8 /* FeatureDetails.swift */,
507+
74C2853C2E7D4B1800A4A5B8 /* NetworkService.swift */,
508+
74C2853D2E7D4B1800A4A5B8 /* OpenHours+Formatting.swift */,
509+
74C2853E2E7D4B1800A4A5B8 /* POICategory.swift */,
510+
74C2853F2E7D4B1800A4A5B8 /* VisitManager.swift */,
511+
);
512+
path = Models;
513+
sourceTree = "<group>";
514+
};
515+
74C285452E7D4B1800A4A5B8 /* Views */ = {
516+
isa = PBXGroup;
517+
children = (
518+
74C285412E7D4B1800A4A5B8 /* ContentView.swift */,
519+
74C285422E7D4B1800A4A5B8 /* DetailsView.swift */,
520+
74C285432E7D4B1800A4A5B8 /* FilterView.swift */,
521+
74C285442E7D4B1800A4A5B8 /* SegmentedToggleView.swift */,
522+
);
523+
path = Views;
524+
sourceTree = "<group>";
525+
};
526+
74C285472E7D4B1800A4A5B8 /* PinPoweredMap */ = {
527+
isa = PBXGroup;
528+
children = (
529+
74C285392E7D4B1800A4A5B8 /* Misc */,
530+
74C285402E7D4B1800A4A5B8 /* Models */,
531+
74C285452E7D4B1800A4A5B8 /* Views */,
532+
74C285462E7D4B1800A4A5B8 /* style.json */,
533+
);
534+
path = PinPoweredMap;
535+
sourceTree = "<group>";
536+
};
537+
74C2854F2E7D4B1800A4A5B8 /* UseCases */ = {
538+
isa = PBXGroup;
539+
children = (
540+
74C285472E7D4B1800A4A5B8 /* PinPoweredMap */,
541+
74C2854E2E7D4B1800A4A5B8 /* UseCasesRoot.swift */,
542+
);
543+
path = UseCases;
544+
sourceTree = "<group>";
545+
};
461546
7E899D0C531F0E3FE49D97BB /* Packages */ = {
462547
isa = PBXGroup;
463548
children = (
@@ -773,6 +858,7 @@
773858
E2CD9B66367265509567A4E3 /* .swiftlint.yml in Resources */,
774859
83DCCC7FEFF6D94D3DF0B587 /* 34M_17.dae in Resources */,
775860
C940835B030A20F0C5BC31AD /* Assets.xcassets in Resources */,
861+
74C285502E7D4B1800A4A5B8 /* style.json in Resources */,
776862
F5E96E5798947CA56FD77CF9 /* Fire_Hydrants.geojson in Resources */,
777863
18F76FE745B049D1F0CAF6CA /* GeoJSONSourceExample.geojson in Resources */,
778864
85AA0D942D4C0E218D87F7D8 /* GradientLine.geojson in Resources */,
@@ -872,6 +958,19 @@
872958
64F4FA139388DB34564AD42D /* CLLocationCoordinate2D+Random.swift in Sources */,
873959
03EDEA6452582E7E6805C824 /* CalloutView.swift in Sources */,
874960
821807D61D52F0E60925BCD4 /* CameraAnimationExample.swift in Sources */,
961+
74C285512E7D4B1800A4A5B8 /* VisitManager.swift in Sources */,
962+
74C285522E7D4B1800A4A5B8 /* PinPoweredMapConstants.swift in Sources */,
963+
74C285562E7D4B1800A4A5B8 /* POICategory.swift in Sources */,
964+
74C285582E7D4B1800A4A5B8 /* FeatureDetails.swift in Sources */,
965+
74C285592E7D4B1800A4A5B8 /* FavoritesManager.swift in Sources */,
966+
74C2855A2E7D4B1800A4A5B8 /* FilterView.swift in Sources */,
967+
74C2855B2E7D4B1800A4A5B8 /* SegmentedToggleView.swift in Sources */,
968+
74C2855C2E7D4B1800A4A5B8 /* OpenHours+Formatting.swift in Sources */,
969+
74C2855D2E7D4B1800A4A5B8 /* DetailsView.swift in Sources */,
970+
74C2855E2E7D4B1800A4A5B8 /* Extensions.swift in Sources */,
971+
74C2855F2E7D4B1800A4A5B8 /* NetworkService.swift in Sources */,
972+
74C285602E7D4B1800A4A5B8 /* ContentView.swift in Sources */,
973+
74C285622E7D4B1800A4A5B8 /* UseCasesRoot.swift in Sources */,
875974
9A403D6AB6D6336E212726C5 /* CameraAnimatorsExample.swift in Sources */,
876975
33B816803AF5330796686AA1 /* CameraForExample.swift in Sources */,
877976
F0502A1ACF0AED218F8184AB /* CarPlayMapViewController.swift in Sources */,
@@ -962,6 +1061,7 @@
9621061
2997D21A7DB20098C6D03D3B /* StandardStyleImportExample.swift in Sources */,
9631062
5DBD7C52D21C20D89418CAA6 /* StandardStyleInteractionsExample.swift in Sources */,
9641063
8F0BEA796867B64E48A1B328 /* StandardStyleLocationsExample.swift in Sources */,
1064+
74C285362E7D4B0100A4A5B8 /* ExamplesRootView.swift in Sources */,
9651065
7352DDB22DD7E9EE000E3000 /* StudioStyleExample.swift in Sources */,
9661066
EB39F159A9F5DFAB935F629D /* SwiftExtensions.swift in Sources */,
9671067
7EDF38D2E9CDE489F320977E /* SwiftUIRoot.swift in Sources */,

Sources/Examples/AppDelegate.swift

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import UIKit
2+
import SwiftUI
23
import Fingertips
34
import OSLog
45
@_spi(Experimental) import MapboxMaps
@@ -118,15 +119,10 @@ final class SceneDelegate: NSObject, UISceneDelegate {
118119

119120
let window = FingerTipWindow(windowScene: windowScene)
120121

121-
let examplesTableViewController = ExampleTableViewController()
122-
let navigationController = UINavigationController(rootViewController: examplesTableViewController)
122+
let rootView = ExamplesRootView()
123+
let hostingController = UIHostingController(rootView: rootView)
123124

124-
let appearance = UINavigationBar.appearance()
125-
appearance.prefersLargeTitles = true
126-
127-
appearance.scrollEdgeAppearance = UINavigationBarAppearance()
128-
129-
window.rootViewController = navigationController
125+
window.rootViewController = hostingController
130126
window.makeKeyAndVisible()
131127

132128
windows.append(window)

Sources/Examples/Assets.xcassets/AccentColor.colorset/Contents.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
"color-space" : "srgb",
66
"components" : {
77
"alpha" : "1.000",
8-
"blue" : "1.000",
9-
"green" : "0.747",
10-
"red" : "0.207"
8+
"blue" : "0xBF",
9+
"green" : "0x38",
10+
"red" : "0x0F"
1111
}
1212
},
1313
"idiom" : "universal"
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"info" : {
3+
"author" : "xcode",
4+
"version" : 1
5+
},
6+
"symbols" : [
7+
{
8+
"filename" : "custom.heart.badge.plus.svg",
9+
"idiom" : "universal"
10+
}
11+
]
12+
}

0 commit comments

Comments
 (0)