From f86df78f80c75bcfa160eb11699b5b995af62c97 Mon Sep 17 00:00:00 2001
From: jakob <jakob.bode@fu-berlin.de>
Date: Mon, 26 Mar 2018 16:55:35 +0200
Subject: [PATCH] show tableview containing contact suggestions, if a software
 keyboard is used aswell

---
 enzevalos_iphone/SendViewController.swift | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/enzevalos_iphone/SendViewController.swift b/enzevalos_iphone/SendViewController.swift
index 7d9ffe7f..649ae24c 100644
--- a/enzevalos_iphone/SendViewController.swift
+++ b/enzevalos_iphone/SendViewController.swift
@@ -353,9 +353,17 @@ class SendViewController: UIViewController {
                     scrollview.contentOffset = CGPoint(x: 0, y: tokenField.frame.origin.y - self.topLayoutGuide.length)
                     tableviewBegin.constant = tokenField.frame.maxY - tokenField.frame.origin.y
                     if #available(iOS 11.0, *) {
-                        tableviewHeight.constant = keyboardY - tableviewBegin.constant
+                        if keyboardY > 0 {
+                            tableviewHeight.constant = keyboardY - tableviewBegin.constant
+                        } else {
+                            tableviewHeight.constant = view.safeAreaLayoutGuide.layoutFrame.size.height - tableviewBegin.constant
+                        }
                     } else {
-                        tableviewHeight.constant = keyboardY - tableviewBegin.constant - (self.navigationController?.navigationBar.frame.maxY)!
+                        if keyboardY > 0 {
+                            tableviewHeight.constant = keyboardY - tableviewBegin.constant - (self.navigationController?.navigationBar.frame.maxY)!
+                        } else {
+                            tableviewHeight.constant = view.bounds.size.height - tableviewBegin.constant - (self.navigationController?.navigationBar.frame.maxY)!
+                        }
                     }
                 } else if !scrollview.isScrollEnabled {
                     scrollview.isScrollEnabled = true
-- 
GitLab