-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2304 from CruGlobal/GT-create-interface-for-open-url
GT create interface for open url
- Loading branch information
Showing
8 changed files
with
87 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
23 changes: 23 additions & 0 deletions
23
godtools/App/Share/Common/UrlOpener/OpenUrlWithSwiftUI.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// | ||
// OpenUrlWithSwiftUI.swift | ||
// godtools | ||
// | ||
// Created by Levi Eggert on 10/23/24. | ||
// Copyright © 2024 Cru. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
import SwiftUI | ||
|
||
class OpenUrlWithSwiftUI: UrlOpenerInterface { | ||
|
||
init() { | ||
|
||
} | ||
|
||
func open(url: URL) { | ||
|
||
@Environment(\.openURL) var environmentOpenUrl | ||
environmentOpenUrl(url) | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
godtools/App/Share/Common/UrlOpener/OpenUrlWithUIKit.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// | ||
// OpenUrlWithUIKit.swift | ||
// godtools | ||
// | ||
// Created by Levi Eggert on 10/23/24. | ||
// Copyright © 2024 Cru. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
import UIKit | ||
|
||
class OpenUrlWithUIKit: UrlOpenerInterface { | ||
|
||
init() { | ||
|
||
} | ||
|
||
func open(url: URL) { | ||
|
||
UIApplication.shared.open(url) | ||
} | ||
} | ||
|
14 changes: 14 additions & 0 deletions
14
godtools/App/Share/Common/UrlOpener/UrlOpenerInterface.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// | ||
// UrlOpenerInterface.swift | ||
// godtools | ||
// | ||
// Created by Levi Eggert on 10/23/24. | ||
// Copyright © 2024 Cru. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
protocol UrlOpenerInterface { | ||
|
||
func open(url: URL) | ||
} |