back soft

مطالب مرتبط با «pass data from one controller to another» در back soft | نویسنده: استخدام کار

Pass data from a button in reused custom cell

Vote count: 0 I'm having trouble passing data from a custom cell by a user tapping a button in that custom cell. I sometimes get the wrong cells data since the cell is being reused. I was wondering if there was a full proof way to always get the right cell data to its button in each cell no matter which cell is currently on the screen. Below is my code. Any help is greatly appreciated. My Custom Cell: protocol CustomCellDelegate { func segueWithCellData() } class CustomTableViewCell : UITableViewCell { var delegate = CustomCellDelegate? @IBAction func buttonTapped() { if let delegate = self.delegate { delegate.segueWithCellData() } } } MyTableViewController: class MyTableViewController : UIT...

ادامه مطلب

برچسب‌های مرتبط

pass data from view to controller | pass data from activity to fragment | pass data from one controller to another | pass data from php to javascript | pass data from controller to directive | pass data from view to controller mvc | pass data from html to javascript | pass data from controller to controller | pass data from fragment to fragment | pass data from one activity to another