Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
- let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "cell", for: indexPath) as! SimpleExampleSubCell
- cell.backgroundColor = UIColor.init(white: 0.10, alpha: 0.25)
- cell.infoLine2TextVw.text = ""
- cell.infoLine3TextVw.text = ""
- if let heading_name = self.dict_dict_holder[indexPath.item]["Name"]{
- cell.headerTextVw.text = heading_name
- cell.infoLine1TextVw.text = self.dict_dict_holder[indexPath.item]["Phone"]
- }
- cell.bringSubview(toFront: cell.headerTextVw)
- cell.favorite_button.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(AddFavorite(withSender:))))
- return cell
- }
- @objc func AddFavorite(withSender sender:UIButton){
- print("clicked")
- //The line below fails each time I run it.
- sender.setImage(newImage.png,.normal)
- }
Add Comment
Please, Sign In to add comment