override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let key = keyArray[indexPath.section-1]
let label = UILabel(frame: CGRectMake(0, 0, 26, 28))
label.center = CGPointMake(26, 28)
cell.accessoryView = label
}
override func tableView(tableView: UITableView, accessoryButtonTappedForRowWithIndexPath indexPath: NSIndexPath) {
print(indexPath)
}
Why for custom label or custom button not call accessoryButtonTappedForRowWithIndexPath
. Or only one way add myButton to cell ?
For custom button you can add target for specific event, accessoryButtonTappedForRowWithIndexPath
will not work for custom view
Please refer:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With