In trying to avoid retain cycles, would using [weak self] in
in a UITableViewCell button action be necessary? Example:
in ViewController\'s cellForRow<
if you're not using the object of tableviewcell and you only want execute action on the cell make this.
var buttonAction: (() -> Void)?
@IBAction func buttonPressed(_ sender: Any) {
buttonAction?()
}
and on the cellForRow use this,
cell.buttonAction = { [weak self] in
self?.someFunction()
}
for check retain cycles, I usually use this option for check if the memory is retain or not.