Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS ChromeSafariBrowserManager - Fixing unnecessary casting of rootViewController to FlutterViewController #567

Merged
merged 1 commit into from
Jan 28, 2021

Conversation

gunantosteven
Copy link
Contributor

I've modified rootViewController using UINavigationController. So It's not relevant to cast the rootViewController with FlutterViewController. It would be good to check the object null or not.

I've tested it, and it works fine both UINavigationController and FlutterViewController.

@pichillilorenzo
Copy link
Owner

Ok, thanks!

Using the if statement this way:

...
if let flutterViewController = UIApplication.shared.delegate?.window.unsafelyUnwrapped?.rootViewController {
...

it already checks if rootViewController is null or not.
Inside the if block, the flutterViewController variable is for sure not null.

@pichillilorenzo pichillilorenzo merged commit 3f2fe9e into pichillilorenzo:master Jan 28, 2021
@pichillilorenzo pichillilorenzo changed the title Fixing wrong casting iOS ChromeSafariBrowserManager - Fixing unnecessary casting of rootViewController to FlutterViewController Jan 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants