Getting error on scrolling while used tableview inside collection view - ios

I have added UITableview inside UICollectionViewCell with auto layout and content of table is very large. I'm getting problem while scrolling tableView cell to top and scroll to next collectionView cell. It goes up in screen. Please see attached image on which I'm suffering.
As we can see all content jump to top
This is content on tableview

Related

UITableView Footer is not showing

enter image description here The Controller is UIViewController.
I have a UIScrollView in UIViewController. A Tableview is added as a subview upon the scrollview. The Scroll view content size is bigger than the screen size. There is a footer in the Tableview. When I am reloading the Tableview first time with the data then the Footer is not displaying but when I started the scroll then the footer is not displaying properly.
Could you please guide me, how to make this resolve.
Thanks
Firstly, it's wrong practise to add UItableview inside scrollview, because tableview already has scrollview underneath it and will adjust the content size of tableview automatically depending on the content you add.
Can you please let me know the reason why you have added tableview inside scrollview?
Remove tableview from scorllview and everything show work fine.

Passing scroll of uitableview in tableview inside uitableviewcell

I've got a UITableView ( let it be big table view ) with two cells. The second cell has UITableView inside. I want to scroll down first cell, than, when it hides from screen on top, i want to disable scroll on the big table view and enable scrolling on the second cell with table view. And when the second table view scrolls to top - enable scrolling on big table view. Here is the link to video :
Video
I've implemented it, but with lag - when scrolling of big table finishes, the transition to scrolling of second cell's table isn't smooth. Did anyone implement this before ? Or can you suggest any github help?) Thanks

UICollectionView scroll whole page

I have a viewController with some text and under it a UICollectionView (about 50% of the page).
My problem is that when I scroll on the collectionView just the cells are being scrolled and not the whole page (the text + the collection cells).
You can think about it like on Instagram profile page (half info half collectionView), when you scroll on Instagram everything is being scrolled and not just the collection cells.
Anyone knows how can I do it?
Thanks!
Add the text content as separate cells on top of the UICollectionView.
Preferably, create a different section which would contain the cells with the top text.
Keep the backgroundColor/backgroundImage of these cells plain to give the effect that they are simply added as UILabels on a form. Doing so will also differentiate from the rest of the actual UICollectionViewCells.
Now, when you scroll the UICollectionView. It will give an effect that the text along with the cells are scrolled.
In Attribute inspector > Scroll View > check Paging enable
Thats because your text/UILabels doesn't belong within the UIScrollView of your UICollectionView, thus it will not be scrolled when the collectionView is. You could create a UICollectionViewCell for your text, include it within your collectionview and expand the collectionView to fit the screen or use a UICollectionViewController

UIScrollView in Custom UITableViewCell mixing up data

I have a UIScrollView in each UITableViewCell of my table view that lays out UIViews horizontally - kind of like the "Featured" section on Apple's App Store. When I'm setting up the UITableViewCell I call a function within the custom UITableViewCell to layout the scroll view. This loops through data assigned to that tableview cell's index path and then creates the custom views and adds them to the scroll view. However, these get mixed up when scrolling the tableview and when the tableview refreshes.
If I clear the subviews before laying them out, it does work. However, I'd like to keep the scroll position at the same point every time it shows the cells. How is this possible?
I've just added an external array that stores the current offset for each scrollview, and then manually set the offset on each scrollview everytime the tableview gets refreshed.

UITableView with a UIView underneath the Cells

I have a UITableView and below the custom cell (in IB) I have inserted a UIView. The UIView gets set to hidden when viewDidLoad() gets called and is only displayed when there is no data in the UITableView. This works great and servers my purpose.
The problem is that even when the UIView is hidden, the scrolling on the UITableView considers the view to be present. i.e. The vertical scroll with scroll well below the last cell, covering the area where the UIView exists - even though its blank and nothing is displayed.
I have tried to hide the UIView but this doesn't help either. How do I get the scroll to not extend to the area covered by the UIView?
Edit:
The image on the left is how IB looks. I have added a UIView as a subview of the TableView. The image on the right is the large scroll space below the last cell.
Expected behavior: When the view is hidden, the scroll view only scrolls until the last cell.
If your view is displayed only when there is no cells, you could just add it over your UITableView (or behind it if your UITableView's background is clear) and hide it when you have cells to display. Just be sure to add your view as a sibling of your UITableView and not as a child view of your UITableView.

Resources