Esri / arcgis-maps-sdk-swift-samples

SwiftUI samples demonstrating various capabilities of ArcGIS Maps SDK for Swift
https://developers.arcgis.com/swift
Apache License 2.0
30 stars 9 forks source link

[Update] Use `LabeledContent` in samples #481

Closed CalebRas closed 1 month ago

CalebRas commented 1 month ago

Description

This PR updates the samples and sample viewer to use LabeledContent to display label/value pairs instead of using a HStack or badge(_:) modifier. The affected samples should be functionally equivalently with minimal UI changes. Generally, the value now has a secondary foreground style if it didn't already.

Linked Issue(s)

How To Test

Replacing FavoritesView.favoriteSamples in arcgis-maps-sdk-swift-samples/Shared/Supporting Files/Views/FavoritesView.swift with the following code will load all of the affected samples in the "Favorites" category for easy testing.

Test Code

```swift private var favoriteSamples: [Sample] { let sampleViews: [any View] = [ AddDynamicEntityLayerView(), AddFeaturesWithContingentValuesView(), Animate3DGraphicView(), ChangeMapViewBackgroundView(), ConfigureClustersView(), CreateLoadReportView(), DensifyAndGeneralizeGeometryView(), GenerateOfflineMapWithCustomParametersView(), OrbitCameraAroundObjectView(), SetVisibilityOfSubtypeSublayerView(), ShowViewshedFromPointInSceneView(), StyleSymbolsFromMobileStyleFileView() ] return sampleViews.map { view in let sampleName = "\(type(of: view))" .dropLast(4) return SamplesApp.samples.first { $0.nameInUpperCamelCase == sampleName }! } } ```

CalebRas commented 1 month ago

I didn't update Analyze network with subnetwork trace since the label/value pairs in the that samples should probably be implemented with a Picker instead.