I have CollectionView in TableView. everything ok but. when I want to navigate my cell to another viewController I got error
func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath){
let storyboard = UIStoryboard(name: "Main", bundle: NSBundle.mainBundle())
let bookView: BookSingleController = storyboard.instantiateViewControllerWithIdentifier("BookSingle") as! BookSingleController
self.navigationController?.pushViewController(bookView, animated: true)
bookView.bookID = "\(self.books[indexPath.row].id)"
print(self.books[indexPath.row].id)
}
Xcode show me error on self.navigationController?.pushViewController(bookView, animated: true) line. this is error description:
Value of 'RelatedBookTableViewCell' has no member 'navigationController'
RelatedBookTableViewCell is my custom cell class:
class RelatedBookTableViewCell: UITableViewCell, UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout
Where is my problem?
thanks.
UIViewControllerinstance. Cells simply do not have a navigation controller property. - donnywals