You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to build generic getAll method will which just return instances of Reusable cells.
By creating that I don't have to register the cells manually I can just add it to the array and in the registerCellsFromReusable() it will be registered.
enumReusable{staticletlistOptionTableCell=ReusableCell<ListOptionTableCell>(nibName:"ListOptionTableCell")staticletseperatorTableCell=ReusableCell<SeperatorTableCell>(nibName:"SeperatorTableCell")staticfunc getAll<T>()->[ReusableCell<T>]where T :UITableViewCell{return[listOptionTableCell, seperatorTableCell]}}overridefunc viewDidLoad(){
super.viewDidLoad()registerCellsFromReusable()}privatefunc registerCellsFromReusable(){Reusable.getAll().forEach{ tableView.register($0)}}
Cool stuff but I don't know why I am getting the below issue even though ListOptionTableCell & SeperatorTableCell inherits from UITableViewCell
The text was updated successfully, but these errors were encountered:
I am trying to build generic
getAll
method will which just return instances of Reusable cells.By creating that I don't have to register the cells manually I can just add it to the array and in the
registerCellsFromReusable()
it will be registered.Cool stuff but I don't know why I am getting the below issue even though
ListOptionTableCell
&SeperatorTableCell
inherits fromUITableViewCell
The text was updated successfully, but these errors were encountered: