Displaying the keyboard above the toolbar? - ipad

I have an ipad app with a single textfield. When the user clicks in the textfield, I want the keyboard to come up without moving or covering the toolbar at the bottom of the screen. The closest I've come to this is the following:
[textField setInputAccessoryView:toolBar];
There are two problems with this.
The keyboard pushes the toolbar up when it appears.
When the keyboard is dismissed, it takes the toolbar with it!
If I could fix 2, then I could probably live with 1, but I'd rather find a solution to both. Thanks!
EDIT: I give up on fixing 1 based on TomSwift's answer, but can someone please tell me if there is a way to push up the toolbar when they keyboard appears and then drop the toolbar back in place when the keyboard disappears???? THANKS!

I'm pretty sure you dont have this option. In iOS the keyboard position is controlled by the OS - you can get notifications of where it is but I dont think you can control where it goes. What you're asking for is to slide the keyboard in and keep going until it's "above" your toolbar at the bottom of the screen.
Have you seen any other apps that do this?

The toolbar disappears upon hiding because it has been added to another view, and therefore removed from its original view. You'll need to re-add it as you initially did.

Related

Keyboard causes UICollectionView Cells loading bug

I got a funny question: "Can someone explain this behaviour?"
Click here to view .gif (I'm not allowed to post pictures yet)
Explanation: When I click on the search bar a new ViewController is being presented (the one you see in the gif). There the keyboard is immediately popping up. When I now dismiss the keyboard by scrolling down it seems like the cells that were behind the keyboard re-render or were not loaded yet... I have no clue where to search for this, so I spared the hassle of posting unnecessary code.
Thanks! :-)
Nothing is wrong with the gif. UITableView cells are created and reused when necessary. That is when they become visible or invisible. Since you changed the view controller with the keyboard popped up, only visible cells are created. The ones behind the keyboard are not initialized yet.

Is it possible to disable a UISearchController for userinputs?

I have this project, where a modal pops up, to filter search results - the UISearchController is visible in my navigation bar when the modal pops up. I can't remove it, as it will look weird, as the modal doesn't fill the whole screen. The problem is, that the UISearchController is still active when the modal pops up, and if I tap it, it all goes crazy - so I want to disable the input field, but I really can't find out how to :/
So does anyone know, how to disable the input field in the UISearchController?
Best regards :-)
self.searchDisplayController.searchBar.userInteractionEnabled = false

UIScrollView: Keyboard dismiss interactively

In the above image the top bar is a custom view which I used like whats app application. Keyboard will dismiss interactively with UIScrollView. I have implemented UIKeyboardWillHideNotification and UIKeyboardDidChangeFrameNotification to move up and down that view. Now the problem is as I used keyboard will dismiss interactively so when user drag his finger to keyboard, it start move up or down accordingly. But I am not able to get any kind of notification to move up or down the view as well.
While I was searching on this matter, I found three different approaches to achieve this.
The easiest is by attaching that custom bar as an input accessory view https://developer.apple.com/documentation/uikit/uiresponder/1621119-inputaccessoryview
You can also attach a dummy view as an input accessory view which emits information about its current location, as described here: https://github.com/brynbodayle/BABFrameObservingInputAccessoryView
Other, the least favourable is to hide the keyboard without any animations and show a captured keyboard static image animating instead, as described here: https://medium.com/#superpeteblaze/ios-custom-keyboard-dismissal-with-swift-9b6df2d9cc49
The keyboard follows the dragging touch offscreen, and can be pulled upward again to cancel the dismiss.
scrollView.keyboardDismissMode = .Interactive
see the Documentation UIScrollViewKeyboardDismissModeInteractive
hope its helpful

How can I prevent clicking iAd from changing my view?

I have an app that displays buttons, the buttons move around the screen upon being touched. The problem I am having is that you can move the buttons around, however if you click on the iAd advertisement after you move the buttons, the buttons return to their original positions. How can I stop this?
Note: I was having the same problem for a while whenever I did a full screen rotation (only landscape supported). Upon rotation the buttons would return to their original positions. I fixed that problem by changing the segue from modal to push. Not sure if this helps but thought I would mention it.
EDIT: I have been trying to use the ViewWillAppear method to correct the layout, however it is not getting called after closing out of the iAd.

2nd uitextfield in modal view not taking keyboard input

I am presenting my modal view using UIModalPresentationFormSheet and I am aware some have had issues resigning first responder and dimissing the keyboard in the past, but my issue is that the second textfield I pick I can't input text. This is hapenning in iPad simulator 4.3.
This happens if I select the second uitextfield while the keyboard of the first textfield is still visible. The cursor will move to the second textfield, but I am unable to edit it. Most of the time I am unable to click the bottom right button which would dismiss the keyboard in iPad, but if it works, I can then select the second textfield and be able to edit it.
Has anyone encountered these issues before?
I am also implementing
-(BOOL)disablesAutomaticKeyboardDismissal { return NO }
Even though this is not a solution it is a workaround. Basically you use a pagesheet instead of form, and resize it.
UIModalPresentationFormSheet resizing view
Even though this is not a solution it is a workaround. Basically you use a pagesheet instead of form, and resize it.
UIModalPresentationFormSheet resizing view

Resources