File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed
Expand file tree Collapse file tree 2 files changed +7
-8
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 @@ -86,7 +86,7 @@ struct SampleDetailView: View {
8686 . toolbar {
8787 ToolbarItemGroup ( placement: . topBarTrailing) {
8888#if targetEnvironment(macCatalyst)
89- Link ( " View on GitHub " , destination: . samplesDirectory . appendingPathComponent ( sample. name ) )
89+ Link ( " View on GitHub " , destination: sample. gitHubURL )
9090#endif
9191 Button {
9292 isSampleInfoViewPresented = true
@@ -112,10 +112,3 @@ struct SampleDetailView: View {
112112extension SampleDetailView : Identifiable {
113113 var id : String { sample. nameInUpperCamelCase }
114114}
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/tree/main/Shared/Samples "
120- ) !
121- }
You can’t perform that action at this time.
0 commit comments