Adding SFSafariViewController code to SwiftUI app causes app to be unresponsive
Expected: Tapping cell in ProfileView navigates user to detail view
Result: Tapping cell in ProfileView causes app to freeze and become unresponsive
Steps to reproduce bug
- Download my project on GitHub
- Copy SafariViewController code in any file (e.g. bottom of OtakuSigmaApp.swift)
- Run app on simulator (or physical device)
- Tap on "Profile" in bottom tabview
- Click on "Total Entries" row
- App should be frozen and unresponsive
But if I get rid of the SafariViewController code, the app works as expected even though I never used the code within my application. Any idea as to why this unrelated behavior is happening? I need to use SFSafariViewController to handle authenticating user through a web browser but it unintentionally causes my app to freeze when a user tries to navigate to a detail view.
import SafariServices
struct SafariWebView: UIViewControllerRepresentable {
let url: URL
func makeUIViewController(context: Context) -> SFSafariViewController {
return SFSafariViewController(url: url)
}
func updateUIViewController(_ uiViewController: SFSafariViewController, context: Context) {
}
}
Simulator, iOS 15