Guest User

Untitled

a guest
Feb 16th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
  2. let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "cell", for: indexPath) as! SimpleExampleSubCell
  3. cell.backgroundColor = UIColor.init(white: 0.10, alpha: 0.25)
  4. cell.infoLine2TextVw.text = ""
  5. cell.infoLine3TextVw.text = ""
  6. if let heading_name = self.dict_dict_holder[indexPath.item]["Name"]{
  7. cell.headerTextVw.text = heading_name
  8. cell.infoLine1TextVw.text = self.dict_dict_holder[indexPath.item]["Phone"]
  9. }
  10. cell.bringSubview(toFront: cell.headerTextVw)
  11. cell.favorite_button.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(AddFavorite(withSender:))))
  12. return cell
  13. }
  14.  
  15.  
  16. @objc func AddFavorite(withSender sender:UIButton){
  17. print("clicked")
  18. //The line below fails each time I run it.
  19. sender.setImage(newImage.png,.normal)
  20. }
Add Comment
Please, Sign In to add comment