Pin UITableView above Interactive Input Accessory View - ios

I have an inputAccessoryView and a UITableView above it, similar to that of the Messages app. The keyboardDismiss mode of the table view is interactive. I've been trying to work out how to add a constraint to the tableview to have it always positioned above the input accessory view, even whilst dragging the keyboard down. However I haven't found a way to do it (since they're not in the same "View"). Has anyone found a way to do this?

Related

Odd collection view scrolling behaviour with UITextField in UICollectionViewCell

I have a UICollectionView with some UICollectionViewCells that contain UITextFields. When a UITextField is selected for editing, the keyboard shows and the UICollectionView moves up accordigly to make the active UITextField visible. I am relying on default behaviour with this and the UITextField is actually appropriately positioned when UIKeyboardDidShowNotification is launched. However, right after that, the UICollectionView will scroll automatically back to the top, and the UITextField will move out of view (behind keyboard).
What could be causing this and how could I debug this behaviour? Please note, that any custom code for UIKeyboardDidShowNotification like scrollRectToVisible or Apple's sample code will not help, as the scrolling off viewable areas happens at a later stage overriding that code. I am just unable to pinpoint the cause of this.
EDITED to add:
An animation to show how the view behaves with a hard keyboard (iPad Pro) when clicking Next to cycles fields. This works fine.
An animation to show how the view behaves with a soft keyboard when clicking Next to cycles fields. Here the keyboard avoiding does not work.

Swift: UITableView scrolls slowly when embedded in ContainerView

I have two container views controlled by a segment controller. When the selected index changes, one view is set hidden and the other one is set visible.
One view contains a tableview, and the other one is a Google Maps view. I tried to remove the Google Maps view completely to see if the scrolling in the tableview would be better, and that fixed the laggy scrolling. So I know that it is the hidden mapView that makes the tableview scroll slowly.
My question is: How can I keep both container views and still have smooth scrolling when the tableView is visible? Setting the container view with the mapView to hidden does not work.
If anyone else has this problem, try to follow this blog and add the views by code instead of using container views in IB. It fixed the problem, and the tableview now scrolls like a pro!
cocoacasts.com/managing-view-controllers-with-container-view-controllers/

Accessibility issue in UIScrollView

In my app we have taken a scrollview with paging enabled inside that i have added multiple custom views which can have multiple individual elements which are all accessible. Now the issue is when accessibility is on and i try to traverse all the elements via right swipe gesture.
Observation: when it comes to last element of first custom view and i perform right swipe gesture it does not jumps the focus to next custom view elements. Any idea how i can make it happen?
I followed voice over can only see a page of a uicollectionview but here there are using collection view and individual elements inside UICollectionViewCell are not accessible
Using paging with a scrollview, the UIPageControl handles movement between the subviews. You really should just leave this control as the accessibility component for navigation as users are familiar with how it works.
https://developer.apple.com/documentation/uikit/uipagecontrol

UIView with container view not scrolling properly when keyboard appears

I have an issue dealing with a UIContainerView inside a UIView. When I try to show the keyboard to edit one of the fields I would expect the whole UIView (with the UIContainerView inside it) to scroll up and out of the way of the keyboard.
Here is what I see at the moment. Does anybody have any suggestions on how to resolve this issue?
The automatic scrolling for input only happens in things like UITableView. For this one, refer to the Apple guide of managing keyboards.
Essentially, you want to manually scroll up the view when the keyboards appear and put it back when the keyboard is hidden.
Edit: I just realised that you have a
UITableViewController. My guess would be because it's on fullscreen, the table view doesn't have enough room to scroll. In this case, you would need to put the all the views inside a scroll view and follow the guide above.

Swift; is scrollView with tableView feasible?

I've have been trying for a while now, to implement a specific behavior in my app. On the initial view of my app, there must be a logo(imageView), a label and a textField. It should be possible to scroll down from the initial view, to a tableView. while the user scrolls down, the label in moved up in the window, to form a search field for the tableView. Then the scrollView should lock to the part with the tableView, and it should only be possible to scroll back up, if dragging elsewhere than the tableView.
What is best practice for doing as described?
The image show (only for illustration, i havn't been using story board when trying to implement it) an overview of the problem:
The way I've tried to do this so far, is by embedding the tableView in a scrollView (as seen on image), enabling paging on the scrollView, and than disabling scrolling on the scrollView, when the buttom part has been reached. I've added a gesture reconizer on the part with of the screen with the textField.
These two posts (Scrollview with embedded tableview and Use Pan Recognizer to Control ScrollView) descripe i further detail what i've tried so far.
But the question is more to, is there an alternate solution for making behaviour descriped above?
Maybe interactive animated transitioning between view controllers somehow?
YES there are! Implement a table view with a header view. And remove the scroll view.
self.tableView.tableHeaderView = topView
where topView will be the view wish as the UIImage, the label and textField

Resources