File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Shared/Supporting Files/Views Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -84,7 +84,10 @@ struct SampleDetailView: View {
8484 . navigationTitle ( sample. name)
8585 . navigationBarTitleDisplayMode ( . inline)
8686 . toolbar {
87- ToolbarItem ( placement: . topBarTrailing) {
87+ ToolbarItemGroup ( placement: . topBarTrailing) {
88+ #if targetEnvironment(macCatalyst)
89+ Link ( " View on GitHub " , destination: . samplesDirectory. appendingPathComponent ( sample. name) )
90+ #endif
8891 Button {
8992 isSampleInfoViewPresented = true
9093 } label: {
@@ -109,3 +112,10 @@ struct SampleDetailView: View {
109112extension SampleDetailView : Identifiable {
110113 var id : String { sample. nameInUpperCamelCase }
111114}
115+
116+ private extension URL {
117+ /// The URL to the Samples sub-directory on GitHub's main branch.
118+ static let samplesDirectory = URL (
119+ string: " https://github.com/Esri/arcgis-maps-sdk-swift-samples "
120+ ) !. appendingPathComponent ( " tree/main/Shared/Samples " )
121+ }
You can’t perform that action at this time.
0 commit comments