Skip to content

nbnitin/Collection-View-Inside-Table-View-Cell

Repository files navigation

Collection-View-Inside-Table-View-Cell

In this I have implemented two method , to adjust collection view inside table view . In both methods I placed collectionview with identifier "cell" left = 10 right = 10 and height width of cell is 68 and tableview's cell height is about 126 with identifier "cell" In method 1 , I have implemeneted by creating extension of tableviewcell with extra variable tablviewindex to full fill my case. case as follow :- Case :- A table view contains 3 sections,each section has two rows with collection view inside in each row. Now , when I click on collection view cell in section 0 on row 0 , then I wouldn't be able to find out section number in this case. For this i took extra variable in tableviewcell class to track section number. Also I have created reference outlet of collectionview delegate and datasource with table view cell . To create reference outlet , select table view cell , and under connection inspector there is reference outlet section , in that there is round corners drag and drop that by holding ctrl key to collectionview in that cell. Then there will be a pop and select and select datasoruce similary do for datasource.Now its ready to use. In method 2 , we haven't implemented this becuase in this case we have one tableview with one section only with multiple rows, in that we have implmeneted in different way by creating extension of tablviewcontroller. Also we have create segue to other view controller. In method 2, I have assigned collectionviewcell class to collectionview cell in that class i have taken 3 variables for different propose, and assign values in cell for item at index path delegate . This creates different objects of collectionviewcell with different data for each and every cell.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages