Passing data in Collection View Cell - ios

I have 1 colleection view with 4 cells which scrolls horizontal just like old youtube ios app. Under these 4 cells, each cell has custom collection view cell with 4 rows scrolls vertically. Under these rows there are customized collection view which scroll horizontally like netflix app with customized collection view cell. How do i pass data from these inner cells to a view controller with naviagation controller. No storyboard are been used. I can not push view controller from collection view cell. Also protocols are not working from inner cells. Any alternative?

Related

Scroll Collection view cells in table view cell to a particular index position

I have the below structure in my app
Table view -> Table Cell -> Collection View -> CollectionView cell
Table view has 10 cells , each table cell has 1 collection view , and the collection view has 20 cells horizontally.
After the data has been loaded , I want the all the collection views to start from index 10 and should be able to scroll back and forth afterwards. Where should make use collectionView.scrollToItem() so that "all" collection views loads from that index.

index out of bounds with UICollectionViews with different amount of items embedded in UITableView

I have a UITableView (vertically scrollable), where each row (Custom TableViewCell) contains a UICollectionView with some CollectionView cells (horizontally scrollable)
However, the collection views have different amount of collection view cells: some have just two or three, others have more than ten.
The problem is: when I am on a row with a collection view that has very many cells and horizontally scroll all the way over to the last cell, and THEN scroll down vertically to a collection view that has only a few collection view cells, I get index out of bounds, because the row is reused and scrolled to further to the right than there are collection view items.
Do you have an idea how I can prevent this? Maybe by preparing for reuse?
1.reload collection in UITableview cell row at indexpath
2.before reload collectionView remove all array belong to collection view

Embed UITableView in a UICollectionViewCell

I have a vertical UICollection view. One of it cells has a table view.
The table view size has it content size, this means there is no scrolling for table view.
The problem is once the collection view cell that has the table view being displayed, all the table view cells loaded. Which means no reusing for the table view cells. since they all loaded.
I had a 52 cells for the table view, All of them loads at the same time on the memory. this makes the app freezing.
I did a debug for the table view datasource call back, the cellForRowAtIndex method is called once for each table view cell at first time. And it doesn't called when scrolling down to see table view cells; This leads me to recognize that there is no reusing for TableViewCells.
Any help?

Scrolling through Table View with embedded Table View Inside a Container View

This is a tableView. The white sections are the tableview cells. In the footer of tableView, I've added a scrollview with 2 containers views embeded with 2 UIViewControllers. These embeded view controllers contains tableView.
Now I'm having a problem with the scrolling. I'm scrolling the main tableview and as I scroll, I'm changing the height of the table footerview on which the scrollview is added. Now the problem is when I scroll through child view controller, I'm not able to scroll to the top of my main tableView. How should I do it? Is there is demo github project which I can refer to any code?
EDIT:
This is how my storyboard looks like:
I want to implement something like Facebook has implemented. I think they are using tableview with page view controller. How can I achieve this?

TableView Controller in Collection View Cell

Problem: I want the user to be able to slide through various tableviews, that will appear in collection view cells. But these tableviews require their own controllers since they will be dynamically sized with different prototype cells. How does one go about doing this in swift 2?
My Failed Approach: Make a storyboard with the tableview controller set up as a scene and then try to instatiate it in code as the collection view cell. I am making the collection view programmatically.

Resources