File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,12 @@ protocol Sample {
4141// MARK: Computed Variables
4242
4343extension Sample {
44+ /// The URL to a sample's sub-directory on GitHub main branch.
45+ var gitHubURL : URL {
46+ URL ( string: " https://github.com/Esri/arcgis-maps-sdk-swift-samples/tree/main/Shared/Samples " ) !
47+ . appendingPathComponent ( name)
48+ }
49+
4450 /// The URL to a sample's `README.md` file.
4551 var readmeURL : URL {
4652 Bundle . main. url ( forResource: name, withExtension: " md " , subdirectory: " READMEs " ) !
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: sample. gitHubURL)
90+ #endif
8891 Button {
8992 isSampleInfoViewPresented = true
9093 } label: {
You can’t perform that action at this time.
0 commit comments