im sending an array of response from one view to another view but by tagging value of tapped header giving pressed function as shown below
func pressed(_ sender: UIButton) {
let ViewAllVC : ViewAllViewController = self.storyboard?.instantiateViewController(withIdentifier: "VIEWALLID") as! ViewAllViewController
ViewAllVC.navigationStringName = "View All"
ViewAllVC.viewAllArray = productDetailsArray[sender.tag] as! NSArray
self.sideMenuViewController?.contentViewController = UINavigationController(rootViewController: ViewAllVC)
}
and in destination view I am setting image for the image view in the cell as follows
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell
{
let cell = tableView.dequeueReusableCell(withIdentifier: "reuseIdentifier", for: indexPath) as! ViewAllCell
if navigationStringName == "View All"
{
let URLBaseString = "http://vehiclebuzzzz.com/"
let url = URL(string:URLBaseString .appending((viewAllArray[i] as AnyObject).value(forKey: "img_name") as? String)
let dataurl = try? Data(contentsOf: url!)
cell.productImageView?.image = UIImage(data: dataurl!)
}
return cell
}
and it is showing for particular category is selected not for all