lib/ProMotion/table/table.rb in ProMotion-2.2.1 vs lib/ProMotion/table/table.rb in ProMotion-2.2.2
- old
+ new
@@ -134,13 +134,14 @@
table_cell = table_view.dequeueReusableCellWithIdentifier(data_cell[:cell_identifier]) || begin
new_cell = data_cell[:cell_class].alloc.initWithStyle(data_cell[:cell_style], reuseIdentifier:data_cell[:cell_identifier])
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
def update_table_data(args = {})
@@ -194,10 +195,9 @@
create_table_cell(data_cell)
end
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
def tableView(table_view, heightForRowAtIndexPath: index_path)