Re:Implementing a Sticky Input Field in iOS
by ayrkm on Sunday August 09, 2015 @08:37AM
(#10030163)
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
by ayrkm on Sunday August 09, 2015 @12:50PM
(#10030673)
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
by sandofsky on Sunday August 09, 2015 @01:27PM
(#10030764)
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.
Re:Implementing a Sticky Input Field in iOS
by sandofsky on Sunday August 09, 2015 @06:28PM
(#10031793)
In 2015, most apps shouldn't support anything below iOS 7.
Create a constraint that attaches the input field to the bottom of the scrollview.
One tradeoff is that dismissal doesn't start until your touch enters the real keyboard area. I'll take it, since it's safer than using KVO to observe private APIs.
Re:Implementing a Sticky Input Field in iOS
by sandofsky on Monday August 10, 2015 @10:19AM
(#10034742)
You're observing the superview in a hierarchy you don't own. In your code, you have an iOS version check, presumably since the property you're looking for changed between iOS versions.
Re:Implementing a Sticky Input Field in iOS
by andkon on Sunday August 09, 2015 @03:22PM
(#10031233)
This is such a great writeup, thank you for digging into it. Have you tried this out with iOS 9? I know JSQMessagesVC, which does a really solid interactive dismissal, has some problems with that.
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.
Create a constraint that attaches the input field to the bottom of the scrollview.
One tradeoff is that dismissal doesn't start until your touch enters the real keyboard area. I'll take it, since it's safer than using KVO to observe private APIs.
The library is not really using KVO to observe private APIs, bounds/center of UIView is public property.
until then, will stick to current solution and test ahead of any new iOS release.
Maybe this decision won't bite you, but this mentality will.
i'm assuming engineers that build FB messenger, WhatsApp, Twitter etc. could be using similar approach, but I am more than happy to be proven wrong.