-
Notifications
You must be signed in to change notification settings - Fork 8
Enable external dismissal #39
Enable external dismissal #39
Conversation
…agic the view controller to add to. Defaults to the top-most view controller of the keywindow.
@tristan-warner-smith The |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this makes sense, however, we need to consider those developers that do not pass a viewHostProvider
and require that the WebView
remain in the hierarchy. LMK if you have any thoughts here, otherwise, we can see about taking what you have here and giving developers like yourself some kind of AuthOnly
view provider option.
…ience initialiser and making hierarchy removal optional
Gotcha, yeah not the case for us pure auth users. I think I've updated the PR with the changes requested, let me know. |
@tristan-warner-smith apologies for the delays and all the back and forth. Please review our updates on PR #41 and let us know if it will suffice for your purposes here. Thanks! |
Feature
Enables external control over the view container in order to enable external dismissal and control of the container. With this approach, a client can give the Magic SDK a ViewController in which to nest itself.
### Scope
WebViewController
is addedWebViewController
to the back (keeping it in the view hierarchy forever) to removing it from the view hierarchy entirely. I'm not sure if there are any other scenarios where this change can be problematic, so you might want to manage this differently.In our case we have a
SwiftUI
app so in order to drive this we need to create a view container, but we need to be able to control the display more directly and dismiss the popup according to our logic.Tradeoffs
webViewPresenter: WebViewControllerPresenting
called fromAuthModule.cancelLogin
, rather than encapsulating all the APIs called onWebViewController
and re-exposing theWebViewController
by protocols insteadAuthModule.cancelLogin
WebViewController
would need to change its constraint code when presented in different containers.