From 50ef6eb76d4449f1fcefc8443e913a8325b345d0 Mon Sep 17 00:00:00 2001 From: Engin Kurutepe Date: Sat, 7 Feb 2015 09:18:27 +0100 Subject: [PATCH] Use the registered layoutAttributesClass `UICollectionViewLayoutAttributes` should not be hardwired because a subclass could have registered a different `layoutAttributesClass`. If not it defaults to `UICollectionViewLayoutAttributes` anyway. --- RFQuiltLayout/RFQuiltLayout.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RFQuiltLayout/RFQuiltLayout.m b/RFQuiltLayout/RFQuiltLayout.m index 3b44102..79a54e4 100644 --- a/RFQuiltLayout/RFQuiltLayout.m +++ b/RFQuiltLayout/RFQuiltLayout.m @@ -103,7 +103,7 @@ - (UICollectionViewLayoutAttributes *)layoutAttributesForItemAtIndexPath:(NSInde CGRect frame = [self frameForIndexPath:indexPath]; - UICollectionViewLayoutAttributes* attributes = [UICollectionViewLayoutAttributes layoutAttributesForCellWithIndexPath:indexPath]; + UICollectionViewLayoutAttributes* attributes = [self.class.layoutAttributesClass layoutAttributesForCellWithIndexPath:indexPath]; attributes.frame = UIEdgeInsetsInsetRect(frame, insets); return attributes; }