Skip to content

Update Example groupings #1123

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 22 additions & 13 deletions Examples/ExamplesApp/Examples.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,31 @@ struct Examples: View {
}

static func makeCategories() -> [Category] {
let common: [Category] = [
.geoview,
.views
]
#if os(iOS) && !targetEnvironment(macCatalyst)
return [.augmentedReality] + common
[.accessories, .augmentedReality, .data, .other]
#else
return common
[.accessories, .data, .other]
#endif
}
}

@MainActor
extension Category {
/// Components that can be used with any geoview.
static var accessories: Self {
.init(
name: "Accessories",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would "Basic" be a better name?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think Accessories is fine.

examples: [
Example("Basemap Gallery", content: BasemapGalleryExampleView()),
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved Basemap Gallery into this category since my original proposal since it can be initialized without specific data on any geoview.

Example("Compass", content: CompassExampleView()),
Example("Overview Map", content: OverviewMapExampleView()),
Example("Scalebar", content: ScalebarExampleView())
]
)
}

#if os(iOS) && !targetEnvironment(macCatalyst)
/// Augmented reality components.
static var augmentedReality: Self {
.init(
name: "Augmented Reality",
Expand All @@ -83,27 +93,26 @@ extension Category {
}
#endif

static var geoview: Self {
/// Components requiring specific data.
static var data: Self {
.init(
name: "GeoView",
name: "Data",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would "Advanced", "Specialty", or "Specialized" be better for this category?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Data is OK for now.

examples: [
Example("Basemap Gallery", content: BasemapGalleryExampleView()),
Example("Bookmarks", content: BookmarksExampleView()),
Example("Compass", content: CompassExampleView()),
Example("Feature Form", content: FeatureFormExampleView()),
Example("Floor Filter", content: FloorFilterExampleView()),
Example("Overview Map", content: OverviewMapExampleView()),
Example("Popup", content: PopupExampleView()),
Example("Scalebar", content: ScalebarExampleView()),
Example("Search", content: SearchExampleView()),
Example("Utility Network Trace", content: UtilityNetworkTraceExampleView())
]
)
}

static var views: Self {
/// General purpose components.
static var other: Self {
.init(
name: "Views",
name: "Other",
examples: [
Example("Floating Panel", content: FloatingPanelExampleView())
]
Expand Down