Skip to content

Conversation

yawboafo
Copy link

@yawboafo yawboafo commented Oct 1, 2019

No description provided.


if #available(iOS 13.0, *) {
if let currentWindowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene {
guard let window = currentWindowScene.windows.first else { fatalError() }
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it safe to use first window? maybe filter it to get the key window?

guard let window = appDelegate.window else { fatalError() }
window?.addSubview(self)
window?.bringSubviewToFront(self)
window?.endEditing(true)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is copy pasted code from above, how about extracting it?

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.

3 participants