cell.initBack { (cell) in
//具体的处理细节
}
cell中的回调属性声明
typealias buyBlockcallbackfunc = (_ cell:ABPurchaseCell)->Void
var buyBlock: buyBlockcallbackfunc?;
func initBack( mathFunction:@escaping (_ cell:ABPurchaseCell)->Void){ buyBlock = mathFunction } @IBAction func clickBtn(_ sender: Any) { if self.buyBlock != nil { self.buyBlock!(self); } }
原文链接:https://www.f2er.com/swift/321060.html