Hacker News new | ask | show | jobs
by sandofsky 3971 days ago
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.
1 comments

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.

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.

Hi sandofsky, that was our previous implementation (dismissal starts only when user's touch enters the real keyboard area) - it doesn't feel 'right'.

The library is not really using KVO to observe private APIs, bounds/center of UIView is public property.

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.
yes, that I agree, it may break between iOS versions. i'm all ear to other approach if any
You file a ticket with Apple and stick with documented APIs.