-
Notifications
You must be signed in to change notification settings - Fork 200
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 #64 from DroidKaigi/MrSmart00/feature/safari
Add SafariView and connect with url links
- Loading branch information
Showing
4 changed files
with
77 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import SafariServices | ||
import SwiftUI | ||
|
||
struct SafariView: UIViewControllerRepresentable { | ||
let url: URL | ||
|
||
func makeUIViewController(context: Context) -> some UIViewController { | ||
let configuration = SFSafariViewController.Configuration() | ||
configuration.barCollapsingEnabled = false | ||
return SFSafariViewController( | ||
url: url, | ||
configuration: configuration | ||
) | ||
} | ||
|
||
func updateUIViewController(_ uiViewController: UIViewControllerType, context: Context) { } | ||
} | ||
|
||
#Preview { | ||
SafariView( | ||
url: URL(string: "https://2023.droidkaigi.jp/")! | ||
) | ||
} | ||
|
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,9 @@ | ||
import Foundation | ||
|
||
extension URL { | ||
static let youtube = URL(string: "https://www.youtube.com/c/DroidKaigi")! | ||
static let xcom = URL(string: "https://x.com/DroidKaigi")! | ||
static let medium = URL(string: "https://medium.com/droidkaigi")! | ||
static let privacyPolicy = URL(string: String(localized: "PrivacyPolicyURL", bundle: .module))! | ||
static let codeOfConduct = URL(string: String(localized: "CodeOfConductURL", bundle: .module))! | ||
} |