diwu / DWURecyclingAlert

Optimizing UITableViewCell For Fast Scrolling
MIT License
559 stars 38 forks source link

Casts for XCode 10.1 version #10

Open demensdeum opened 5 years ago

demensdeum commented 5 years ago

Casts for correct XCode 10.1 build:

diff --git a/RecyclingAlert/DWURecyclingAlert/DWURecyclingAlert.m b/RecyclingAlert/DWURecyclingAlert/DWURecyclingAlert.m
index 122336b..8ffcc32 100644
--- a/RecyclingAlert/DWURecyclingAlert/DWURecyclingAlert.m
+++ b/RecyclingAlert/DWURecyclingAlert/DWURecyclingAlert.m
@@ -246,7 +246,7 @@ static void dwu_swizzleDrawRectIfNotYet(CALayer *layer) {
     if (![layer.delegate isKindOfClass:[UIView class]]) {
         return;
     }
-    UIView *containerView = layer.delegate;
+    UIView *containerView = (UIView *)layer.delegate;
     if (!dwu_implementsSelector(containerView, @selector(drawRect:))) {
         return;
     }
@@ -316,7 +316,7 @@ - (void)dwu_scanLayerHierarchyRecursively {
 }

 - (UIView *)dwu_findCell {
-    UIView *containerView = self.delegate;
+    UIView *containerView = (UIView *) self.delegate;
     if (!containerView) {
         return nil;
     }
@@ -338,7 +338,7 @@ - (UIView *)dwu_findCell {

 - (void)dwu_injectLayer: (CALayer *)layer withCellDelegate:(UIView *)cellDelegate {
     if (layer.delegate && [layer.delegate isKindOfClass:[UIView class]]) {
-        UIView *containerView = layer.delegate;
+        UIView *containerView = (UIView *) layer.delegate;
         containerView.dwuCellDelegate = cellDelegate;
     }
 }
@@ -465,4 +465,4 @@ static void dwu_generateTimeLabelForUICollectionViewCell() {
         dwu_generateTimeLabelForUICollectionViewCell();
     }
 }
-#endif
\ No newline at end of file
+#endif