I have a UITableViewController
, inside the TableViewCell
, it\'s a UICollectionView
. I want to pass the data from the CollectionV
So, You have not implemented the
func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
...
}
and
func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell
methods in your second implementation. Also, try putting an invisible button over the collection view cell and assign the tag to be the indexpath of that collectionview cell like this:
func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell
{
....
myButton.tag = indexpath.item
}
After this you may either implement a delegate callback from collectionviewcell class to the homepagetableviewcontroller class or push the detail view controller directly by code.
As far as setting of image in the detail view controller is concerned. You can do it both in viewdidLoad() or viewDidAppear(). Its fine.