A SwiftUI library for presenting SFSafariViewController and starting ASWebAuthenticationSession with proper native presentation styles.
BetterSafariView is a SwiftUI library that provides a native way to present SFSafariViewController and start ASWebAuthenticationSession. It solves the limitation in SwiftUI where these UIKit components cannot be presented with their default push transition style, offering a seamless integration that matches Apple's design expectations.
SwiftUI developers building iOS, macOS Catalyst, macOS, or watchOS apps that need to embed web content or handle OAuth authentication flows.
Developers choose BetterSafariView because it provides idiomatic SwiftUI APIs for Safari and authentication sessions, enabling full-screen push transitions and avoiding double navigation bars or modal sheets that break native presentation behavior.
A better way to present a SFSafariViewController or start a ASWebAuthenticationSession in SwiftUI.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Solves SwiftUI's limitation by presenting SFSafariViewController with full-screen push transitions instead of modal sheets, avoiding double navigation bars as highlighted in the motivation section.
Uses familiar modifier syntax like .safariView(isPresented:content:) and .webAuthenticationSession(isPresented:content:), making integration seamless for SwiftUI developers.
Works on iOS, macOS Catalyst, macOS, and watchOS with platform availability checks, enabling consistent authentication flows across Apple ecosystems.
Offers modifiers for bar accent colors, control accent colors, and dismiss button styles in SafariView, allowing design alignment with your app.
The README admits a key issue: the .webAuthenticationSession(item:content:) modifier doesn't handle identity changes properly due to lack of non-hacky dismissal animation notifications.
Limited to only SFSafariViewController and ASWebAuthenticationSession, providing no support for other web view needs like WKWebView integration or complex web content handling.
As a wrapper for UIKit components, future iOS or SwiftUI changes could break compatibility or render it obsolete if Apple introduces native SwiftUI alternatives.