From d6113a1d6ff8597a3ccbe86249a967b188e3b64a Mon Sep 17 00:00:00 2001 From: jahorton Date: Fri, 31 Jan 2020 14:40:14 +0700 Subject: [PATCH 1/2] fix(ios): Fixes margins on keyboard in iOS 9/10 --- .../Classes/InputViewController.swift | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/ios/engine/KMEI/KeymanEngine/Classes/InputViewController.swift b/ios/engine/KMEI/KeymanEngine/Classes/InputViewController.swift index ea20dfefb1..4d67fcde9f 100644 --- a/ios/engine/KMEI/KeymanEngine/Classes/InputViewController.swift +++ b/ios/engine/KMEI/KeymanEngine/Classes/InputViewController.swift @@ -74,9 +74,11 @@ private class CustomInputView: UIInputView, UIInputViewAudioFeedback { let innerView = keymanWeb.view! var guide: UILayoutGuide + var conditionalGuide: Bool = false if #available(iOSApplicationExtension 11.0, *) { guide = self.safeAreaLayoutGuide + conditionalGuide = true } else { guide = self.layoutMarginsGuide } @@ -84,11 +86,21 @@ private class CustomInputView: UIInputView, UIInputViewAudioFeedback { // Fallback on earlier versions innerView.topAnchor.constraint(equalTo: guide.topAnchor).isActive = true innerView.bottomAnchor.constraint(equalTo: guide.bottomAnchor).isActive = true - innerView.leftAnchor.constraint(equalTo: guide.leftAnchor).isActive = true - innerView.rightAnchor.constraint(equalTo: guide.rightAnchor).isActive = true + if conditionalGuide { + innerView.leftAnchor.constraint(equalTo: guide.leftAnchor).isActive = true + innerView.rightAnchor.constraint(equalTo: guide.rightAnchor).isActive = true + } else { + innerView.leftAnchor.constraint(equalTo: self.leftAnchor).isActive = true + innerView.rightAnchor.constraint(equalTo: self.rightAnchor).isActive = true + } // Allow these to be broken if/as necessary to resolve layout issues. - let kbdWidthConstraint = innerView.widthAnchor.constraint(equalTo: guide.widthAnchor) + var kbdWidthConstraint: NSLayoutConstraint + if conditionalGuide { + kbdWidthConstraint = innerView.widthAnchor.constraint(equalTo: guide.widthAnchor) + } else { + kbdWidthConstraint = innerView.widthAnchor.constraint(equalTo: self.widthAnchor) + } kbdWidthConstraint.priority = .defaultHigh kbdWidthConstraint.isActive = true From 8f731a1e006cca8e3859d75025bf187d8ad379f1 Mon Sep 17 00:00:00 2001 From: jahorton Date: Mon, 3 Feb 2020 08:05:28 +0700 Subject: [PATCH 2/2] chore(ios): history.md --- ios/history.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ios/history.md b/ios/history.md index 3e8211446a..bf083601c8 100644 --- a/ios/history.md +++ b/ios/history.md @@ -1,5 +1,8 @@ # Keyman for iPhone and iPad Version History +## 2020-02-03 13.0.63 beta +* Bug fix: Fixes keyboard widths/margins in iOS 9 and 10 (#2560) + ## 2020-01-30 13.0.62 beta * Feature: Initial keyboard setup process simplified with direct Settings link [iOS 11.0+ only] (#2548) * Bug fix: System keyboard now respects "Sounds > Keyboard Clicks" setting (#2550)