diff --git a/lib/ProMotion/table/table.rb b/lib/ProMotion/table/table.rb index 1eadfef..67ca434 100644 --- a/lib/ProMotion/table/table.rb +++ b/lib/ProMotion/table/table.rb @@ -136,9 +136,10 @@ module ProMotion new_cell.extend(PM::TableViewCellModule) unless new_cell.is_a?(PM::TableViewCellModule) new_cell.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleLeftMargin|UIViewAutoresizingFlexibleRightMargin new_cell.clipsToBounds = true # fix for changed default in 7.1 - new_cell.setup(data_cell, self) new_cell end + + table_cell.setup(data_cell, self) if table_cell.respond_to?(:setup) table_cell.send(:on_reuse) if !new_cell && table_cell.respond_to?(:on_reuse) table_cell end @@ -196,7 +197,6 @@ module ProMotion def tableView(table_view, willDisplayCell: table_cell, forRowAtIndexPath: index_path) data_cell = self.promotion_table_data.cell(index_path: index_path) - table_cell.setup(data_cell, self) if table_cell.respond_to?(:setup) table_cell.send(:will_display) if table_cell.respond_to?(:will_display) table_cell.send(:restyle!) if table_cell.respond_to?(:restyle!) # Teacup compatibility end