From 9c5f12d32f9a263d07df1523769adf45558fe604 Mon Sep 17 00:00:00 2001 From: Ricky Romero Date: Sun, 10 Jun 2018 18:33:29 -0700 Subject: [PATCH] Documentation fix for unsatisfiable constraints --- README.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3bc8613..221a99e 100644 --- a/README.md +++ b/README.md @@ -71,13 +71,20 @@ pod "KeyboardAdjuster", "~> 3" func viewDidLoad() { super.viewDidLoad() + var bottomBoundaryConstraint: NSLayoutConstraint + var keyboardTopConstraint: NSLayoutConstraint + if #available(iOS 11, *) { - tableView.bottomAnchor.constraint(lessThanOrEqualTo: view.safeAreaLayoutGuide.bottomAnchor).isActive = true + bottomBoundaryConstraint = tableView.bottomAnchor.constraint(lessThanOrEqualTo: view.safeAreaLayoutGuide.bottomAnchor) } else { - tableView.bottomAnchor.constraint(lessThanOrEqualTo: view.bottomAnchor).isActive = true + bottomBoundaryConstraint = tableView.bottomAnchor.constraint(lessThanOrEqualTo: view.bottomAnchor) } - tableView.bottomAnchor.constraint(greaterThanOrEqualTo: keyboardLayoutGuide.topAnchor).isActive = true + bottomBoundaryConstraint.isActive = true + + keyboardTopConstraint = tableView.bottomAnchor.constraint(equalTo: keyboardLayoutGuide.topAnchor) + keyboardTopConstraint.priority = UILayoutPriority(rawValue: 999) + keyboardTopConstraint.isActive = true } ```