Live data from Hacker News

Implementing a Sticky Input Field in iOS

medium.com

1–10 of 19 posts

Re: Implementing a Sticky Input Field in iOS

#2
Interesting work, thanks for sharing.

  The input field is subview of the keyboard’s window. This is likely undesirable, especially for chat applications.
I am curious as to why this is undesirable. It makes sense to me that something docked to the keyboard would be in the same window.

Re: Implementing a Sticky Input Field in iOS

#3
post #2

Interesting work, thanks for sharing. The input field is subview of the keyboard’s window. This is likely undesirable, especially for chat applications. I am curious as to why this is undesirable. It makes sense to me that something docked to the keyboard would be in the same window.

It's because the input field will always appear at window level above the level of key window. So, if you need to show overlay in key window, the input field will appear above the overlay. Example for such overlay could be a loading indicator.

Re: Implementing a Sticky Input Field in iOS

#7

Or you can use Slack's open sourced version: https://github.com/slackhq/slacktextviewcontroller

hi Aaron, I did briefly look at SlackTextViewController. But decided not to use it because the project contains many features that we do not need. Furthermore, it doesn't support usage on iPad.

Re: Implementing a Sticky Input Field in iOS

#9

There's no mention in the article that since iOS 7, there's been a "UIScrollViewKeyboardDismissMode", which allows "interactive" dismissal. It isn't perfect, but the last time I investigated, too many solutions out there involved touching private APIs.

I could've more explicit.

Interactive dismissal only made possible with UIScrollViewKeyboardDismissModeInteractive introduced since iOS 7.

This article described solution for interactive dismissal with `sticky` input field atop the keyboard.

Post reply on HN