mercredi 20 février 2019

Delegate or closure for multiple event in same object

There is

var tableView: MyTableView?
tableView?.onGoToA = {
    self.goToA();
}
tableView?.onGoToB = {
    self.goToB();
}
tableView?.onGoToC = {
    self.goToC();
}

are there better way for this case or better that just use delegate?

Aucun commentaire:

Enregistrer un commentaire