1

I am working on a view in my app involves 3 main parts:

  • A custom in-app keyboard
  • A 'Controller' view, which is actually another ViewController in a container view with multiple controls and the textField that has my custom keyboard as inputview
  • Lastly, a view that displays the entered data.

Now, I am working on an proper design for this screen and I figured it would look good if a small part of my 'Controller' view would overlap the keyboard I have. I tried things like:

  • Added everything, including the keyboard into a stack view which gets it underneath the view I want, until you select or de-select the textField when it just displays another keyboard on top of it all
  • Tried, as multiple other SO Answers suggest, to add it in the same window as the Keyboard is in with: UIApplication.shared.windows[UIApplication.shared.windows.count - 1].addSubview(textController.view) which results in a crash: child view controller: View should have parent view controller:(null) but actual parent is: PresentingViewController
  • Manipulating the z-position of the 'Controller' view to float. Float.greatestFiniteMagnitude but won't get it on top of the keyboard.

Question: What is the best way to get the view of a container view on top of the keyboard in iOS?

Joris416
  • 4,751
  • 5
  • 32
  • 59
  • Possible duplicate of [How to overlay a view above a keyboard in iOS](https://stackoverflow.com/questions/48564660/how-to-overlay-a-view-above-a-keyboard-in-ios) – Sahil Kapoor Sep 16 '18 at 22:48
  • @SahilKapoor Thanks for your attention but this solution does not work for me as I point out in my question (second bullet point of things I tried). Would you have any other idea that might help? – Joris416 Sep 16 '18 at 22:53

0 Answers0