Keyboard does not dismiss interactively - ios

On an iOS app, I have the following view structure:
UIViewController > UIView > UIScrollView > UITextView
The UIScrollView has the "Dismiss Interactively" setting. When I tap on the UITextView, the keyboard pops-up properly. However I now try to gradually dismiss the keyboard by slowly swiping my finger down, but nothing happens.
Did I forget anything in my configuration ?
Example project

Since iOS 7, you can use
scrollView.keyboardDismissMode = .Interactive
The keyboard follows the dragging touch offscreen and can be pulled upward again to cancel the dismiss.

Issue was linked to the fact that the scrollView contents were shorter than the screen size.

Related

How to prevent popover scaling when keyboard appears?

My iPad app has a popover with a few UITextFields at the top half.
When tapping a textfield, which makes the keyboard appear, iOS scales (and moves) my popover. I don't want that.
How do I prevent iOS from doing that?
This answer suggests to override some keyboardWillShow() and keyboardWillHide() functions, but it's unclear where these are defined.

iOS keyboard appearance messing up other view

I have UITextField, UIButton and UIImageView inside my view. On viewDidLoad I am animating (moving up) button and image and setting them on some specific position. But when user taps on a textfield to edit it, as the keyboard appears the button and image move back to their original positions.
I don't want any view to move back after my animation finishes. The keyboard appearance is messing up my views. Why its happening or how can I prevent it from happening?

Present UIPopoverController from a moving rect

Just got this weird problem, where I have a scroll view and buttons in the scroll view. I want to display a UIPopover from the button when touched, with UITextFields inside the UIPopover. The problem comes when the Keyboard appears. In certain cases, when the UIButton is so high in the view that the popover can only be displayed under it with the UIPopoverArrowDirectionUp, and when keyboard pops in, this popover cannot move any more up and therefore magically disappears to the top left corner (probably some Apple thing).
My solution is to check the frame of the UIPopover and to check that there is enough space for the keyboard, and if not, scroll the UIScrollView up with the buttons as well in order to be able to push the UIPopover up and so make sure that both the Keyboard and the popover fit.
So the question is: Is it possible to move the popover as the button moves?
Thanks

How do I make my UITextView autoscroll when dragging caret to the edge of view?

In the iOS's Notes app, I wrote very long text on the TextView,
then I long press on the view, bring up the magnifier loupe, drag it to the bottom of screen (or top of the keyboard, if it is activated), the TextView will automatically scroll up.
How can I implement this with UITextView?
I tried
Add a UILongPressGestureRecognizer to my UITextView subclass, but its action never get called.
Override touchesMoved:withEvent: method in my UITextView subclass, but this method will not be called after the magnifier loupe appears.
You don't implement it; that's standard behaviour.
The magnifier scrolling occurs when you drag the magnifier off the bottom or off the top of the UITextView, or when you're close on the edge, about 10 pixels? (best to test this in the simulator where to have exact-control over the touch-position). If your text view is full-screen you may not be able to drag to a position outside the view, and the touch-region for scrolling may just be too small.
Notice in the Notes app that to scroll down you can drag the magnifier onto the tabs at the bottom. To go up you can drag it into the title. So long as you hold the touch outside the view it'll scroll.
All this also means your view can't go behind the keyboard when it's present. You need to resize the UITextView when the keyboard appears to get the scrolling to work.

Adjust UIPopover when the iPad keypad splits

I have an iPad app in landscape orientation.
Which has multiple UIButtons on the screen from top to bottom which present a UIPopover with a TextView in it.
When the keyboard appears and covers the button, the popover moves over the keyboard, and comes back nicely when the keyboard is dismissed.
but when the keyboard is suddenly put into split mode and if the popover was for a button below the keyboard then the popover comes back and goes behind one of the halves of the keyboard.
How should such situation be handled gracefully ?
Would creating a transparent view/button that you launch the Popover view from work? Then you could move the button to where ever you want.

Resources