Is weak self needed for table view cell button closure
问题 In trying to avoid retain cycles, would using [weak self] in in a UITableViewCell button action be necessary? Example: in ViewController's cellForRow cell.buttonAction = { (cell) [weak self] in self.someFunction() } in TableViewCell class var buttonAction: ((UITableViewCell) -> Void)? @IBAction func buttonPressed(_ sender: Any) { buttonAction?(self) } 回答1: The key line to think about is: var buttonAction: ((UITableViewCell) -> Void)? You are offering to store a function long-term in an