diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2021-04-14 12:30:40 +0200 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2021-04-29 15:43:45 +0200 |
| commit | c1d457ab3d7e58701a696e374ed621bc31504352 (patch) | |
| tree | 55090907a1118131afa9276ab4d91a297867024a | |
| parent | 69a13855a0c739121bb2c740f4d4be5d4707db07 (diff) | |
| download | mullvadvpn-c1d457ab3d7e58701a696e374ed621bc31504352.tar.xz mullvadvpn-c1d457ab3d7e58701a696e374ed621bc31504352.zip | |
Keyboard: refactoring
| -rw-r--r-- | ios/MullvadVPN/AutomaticKeyboardResponder.swift | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/ios/MullvadVPN/AutomaticKeyboardResponder.swift b/ios/MullvadVPN/AutomaticKeyboardResponder.swift index d5d7c18cd2..04518a40ef 100644 --- a/ios/MullvadVPN/AutomaticKeyboardResponder.swift +++ b/ios/MullvadVPN/AutomaticKeyboardResponder.swift @@ -88,20 +88,19 @@ class AutomaticKeyboardResponder { private var parentViewController: UIViewController? { var responder: UIResponder? = targetView let iterator = AnyIterator { () -> UIResponder? in - let next = responder?.next - responder = next - return next + responder = responder?.next + return responder } return iterator.first { $0 is UIViewController } as? UIViewController } + /// Returns the presentation container view that's moved along with the keyboard on iPad private var presentationContainerView: UIView? { var currentView = parentViewController?.view let iterator = AnyIterator { () -> UIView? in - let next = currentView?.superview - currentView = next - return next + currentView = currentView?.superview + return currentView } // Find the container view that private `_UIFormSheetPresentationController` moves |
