I am new to swift
The tableview contain multiple images working fine this the code :
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "Media", for: indexPath)as! MediaCustomTableViewCell
let row = indexPath.row
let media = Mediainfo[row] as MediaEvent
cell.DisplayDate.text = media.date
cell.DisplayName.text = media.eventName
cell.selectionStyle = .none
cell.DisplayImage.downloadImageFrom(link:media.bannerImages, contentMode: UIViewContentMode.scaleAspectFit)
return cell
}
override func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
return CGFloat.leastNormalMagnitude
}
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath)
{
let media = Mediainfo[(indexPath.row)] as MediaEvent
let ImageStoryboard = UIStoryboard(name: "Main", bundle: nil)
let ImageController = ImageStoryboard.instantiateViewController(withIdentifier: "IMAGESCOL")as!ImagesCollectionViewController
Here I'm passing an image to a collection view but its not working:
ImageController.RecivedData1 = media.bannerImages
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let tabcontroller = storyboard.instantiateViewController(withIdentifier: "IMAGEVID") as! UITabBarController
navigationController?.pushViewController(tabcontroller, animated: true)
}
After select any image in tableview cell image should show at tab bar with collection view. I am showing images and videos categories wise I can use tab bar controller
Data pass to:
Tableview ---> tab bar controller ===> 2 collection views
How can pass the tableview images data to collection using tab bar controller?