Page view constraints bug - ios

I have set up a page view controller in swift with a scroll view and a view inside the scroll view. I made constraints for both of them but when I run the project on swiping left or right between the pages the view in the scroll view first comes a little bit smaller and then when the swipe is completed it expands.
Here is the problem:

Related

Scroll view only horizontally

I have successfully set up a scroll view into my Main View Controller so it only scrolls vertically. I then proceeded the same way to set another scroll view in my Wallet View Controller but it keeps scrolling horizontally too! I tried every programmatical solution but I could not fix it. The constrains are absolutely the same in both situations which drives me nuts.
Here are a few screenshots of what is going on:
What is the problem?

ScrollViews and Segmented controller

This is really odd, but I have a segmented controller and both of the views have a scroll view. So when you click on one half of the segmented controller that view has a scroll view, and the other half also has a scroll view. For some bizarre reason only one of the views will scroll. I need them both to scroll. Does this made sense?
First in the viewDidLoad I added a subview for both of them. Then I added an if else statement with .isHidden and that works beautifully.

Stop table view from bouncing when presenting view controller

I currently have a view controller that has a segmented control and a table view as subviews of its view. The following view controller is always displayed within a navigation controller (including its toolbar) and it’s subviews are laid out as follows:
Segmented control: Top, leading and trailing constraints are pinned to the superview with constant values of 0.
Table view: Bottom, leading and trailing constraints are pinned to the superview with constant values of 0.
The segmented controls bottom to the table views top have a constant value of 8.
The view is resized and works without any issues when displayed within a navigation controller. I can scroll both up and down and all cells are visible.
The current problem I have is when I have scrolled down to the last cell and I want to present another view controller using the presentViewController:animated:completion: method. The issue is the whole table view bounces up, hits the segmented control and scrolls up 1 cell to the second last cell automatically. This is a behaviour I do not want as I don’t want the user to have to scroll down to the last cell again. This happens even if only part of the last cell is visible. There is no bouncing when I present the view controller when the last cell is scrolled out of view.
So far I’ve tried turning off all bounces and it still doesn’t stop this behaviour.
Any ideas on what’s causing this and how I could stop it from happening? I’ve been stuck on this for the past 3 days.

UIScrollView that has UITableViews as subviews won't scroll horizontally

I have a view controller that owns a UISegmentedControl, a UIScrollView, and several UITableViews. The segmented control and the scroll view are subviews of the view controller's root view. The table views are subviews of the scroll view. The scroll view takes up all the space below the segmented control and each table view is as large as the scroll view. Table views are placed horizontally aligned inside the scroll view.
The view controller should support scrolling to one of its table views either by selection in the segmented control (that works) or by swipe gesture (that does not work yet). I have checked that the scroll view's contentSize is appropriate and I have also tried turning the table view cells' userInteractionEnabled off. I have also checked that the table views do not exceed the size of the scroll view as discussed here. (Each table view is as large as the scroll view, albeit at a horizontal offset.) Still the scroll view can|t be swiped horizontally as I would expect.
Could it be that the table views themselves consume all (including horizontal) swipe gestures as part of their support for vertical scrolling? How can I ensure that the scroll view further up in the scroll hierarchy can (also) react to such swipe gestures?

Autolayout and embeded scroll views

I have a view that contains a scroll view and that scroll view has another 2 views in it: on top a standard view, and under that another view. This last view has a scroll view inside it. (a matroshka doll has nothing on this app) .
The problem is there is a button that causes the bottom view to resize and increase it's height, but the outer scroll view doesn't increase content size. So the bottom part of the bottom view (now resized to be bigger) is not visible.
Any suggestions on how to fix this mess ?

Resources