From 590eb9b8d96f0efc6a0f72cf200b3daf114d4a0d Mon Sep 17 00:00:00 2001 From: Gareth Miller Date: Fri, 21 Sep 2018 11:35:01 +0100 Subject: [PATCH 1/4] Added ios version checks --- .../DZNEmptyDataSet.xcodeproj/project.pbxproj | 6 +++++- .../xcschemes/DZNEmptyDataSet.xcscheme | 4 +--- .../xcschemes/DZNEmptyDataSetTests.xcscheme | 4 +--- .../Pods/Pods.xcodeproj/project.pbxproj | 6 +++++- Source/UIScrollView+EmptyDataSet.m | 18 +++++++++++------- 5 files changed, 23 insertions(+), 15 deletions(-) diff --git a/DZNEmptyDataSet/DZNEmptyDataSet.xcodeproj/project.pbxproj b/DZNEmptyDataSet/DZNEmptyDataSet.xcodeproj/project.pbxproj index ea20bc1a..2f79e495 100644 --- a/DZNEmptyDataSet/DZNEmptyDataSet.xcodeproj/project.pbxproj +++ b/DZNEmptyDataSet/DZNEmptyDataSet.xcodeproj/project.pbxproj @@ -428,7 +428,7 @@ F58A3E291E66AEE90086E0EF /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0920; + LastUpgradeCheck = 1000; ORGANIZATIONNAME = DZN; TargetAttributes = { F58A3E311E66AEE90086E0EF = { @@ -666,6 +666,7 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; @@ -673,6 +674,7 @@ CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; @@ -723,6 +725,7 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; @@ -730,6 +733,7 @@ CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; diff --git a/DZNEmptyDataSet/DZNEmptyDataSet.xcodeproj/xcshareddata/xcschemes/DZNEmptyDataSet.xcscheme b/DZNEmptyDataSet/DZNEmptyDataSet.xcodeproj/xcshareddata/xcschemes/DZNEmptyDataSet.xcscheme index 67b2997d..cd5f7e21 100644 --- a/DZNEmptyDataSet/DZNEmptyDataSet.xcodeproj/xcshareddata/xcschemes/DZNEmptyDataSet.xcscheme +++ b/DZNEmptyDataSet/DZNEmptyDataSet.xcodeproj/xcshareddata/xcschemes/DZNEmptyDataSet.xcscheme @@ -1,6 +1,6 @@ _contentView.alpha = 1.0;}; if (self.fadeInOnDisplay) { [UIView animateWithDuration:0.25 From 5095451dd0af9f2d7d43b25b87c49773bfd72171 Mon Sep 17 00:00:00 2001 From: Gareth Miller Date: Thu, 27 Sep 2018 11:00:43 +0100 Subject: [PATCH 2/4] Added self to remove warning --- .../DZNEmptyDataSet.xcodeproj/project.pbxproj | 10 +++++++--- .../xcshareddata/xcschemes/DZNEmptyDataSet.xcscheme | 4 +--- .../xcschemes/DZNEmptyDataSetTests.xcscheme | 4 +--- Source/UIScrollView+EmptyDataSet.m | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/DZNEmptyDataSet/DZNEmptyDataSet.xcodeproj/project.pbxproj b/DZNEmptyDataSet/DZNEmptyDataSet.xcodeproj/project.pbxproj index ea20bc1a..0810a303 100644 --- a/DZNEmptyDataSet/DZNEmptyDataSet.xcodeproj/project.pbxproj +++ b/DZNEmptyDataSet/DZNEmptyDataSet.xcodeproj/project.pbxproj @@ -428,7 +428,7 @@ F58A3E291E66AEE90086E0EF /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0920; + LastUpgradeCheck = 1000; ORGANIZATIONNAME = DZN; TargetAttributes = { F58A3E311E66AEE90086E0EF = { @@ -666,6 +666,7 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; @@ -673,6 +674,7 @@ CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; @@ -700,7 +702,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -723,6 +725,7 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; @@ -730,6 +733,7 @@ CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; @@ -751,7 +755,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; diff --git a/DZNEmptyDataSet/DZNEmptyDataSet.xcodeproj/xcshareddata/xcschemes/DZNEmptyDataSet.xcscheme b/DZNEmptyDataSet/DZNEmptyDataSet.xcodeproj/xcshareddata/xcschemes/DZNEmptyDataSet.xcscheme index 67b2997d..cd5f7e21 100644 --- a/DZNEmptyDataSet/DZNEmptyDataSet.xcodeproj/xcshareddata/xcschemes/DZNEmptyDataSet.xcscheme +++ b/DZNEmptyDataSet/DZNEmptyDataSet.xcodeproj/xcshareddata/xcschemes/DZNEmptyDataSet.xcscheme @@ -1,6 +1,6 @@ _contentView.alpha = 1.0;}; if (self.fadeInOnDisplay) { [UIView animateWithDuration:0.25 From a12bc1e6cfa56d97e6c4766a508d39f3c3783f43 Mon Sep 17 00:00:00 2001 From: Gareth Miller Date: Thu, 27 Sep 2018 11:03:11 +0100 Subject: [PATCH 3/4] removed ios checks --- Source/UIScrollView+EmptyDataSet.m | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Source/UIScrollView+EmptyDataSet.m b/Source/UIScrollView+EmptyDataSet.m index 9f58eccf..40ff016b 100644 --- a/Source/UIScrollView+EmptyDataSet.m +++ b/Source/UIScrollView+EmptyDataSet.m @@ -481,8 +481,7 @@ - (void)dzn_reloadEmptyDataSet UIImage *image = [self dzn_image]; UIColor *imageTintColor = [self dzn_imageTintColor]; - if (@available(iOS 7.0, *)) { - UIImageRenderingMode renderingMode = imageTintColor ? UIImageRenderingModeAlwaysTemplate : UIImageRenderingModeAlwaysOriginal; + UIImageRenderingMode renderingMode = imageTintColor ? UIImageRenderingModeAlwaysTemplate : UIImageRenderingModeAlwaysOriginal; view.verticalSpace = [self dzn_verticalSpace]; @@ -498,7 +497,6 @@ - (void)dzn_reloadEmptyDataSet view.imageView.image = image; } } - } // Configure title label if (titleLabelString) { @@ -535,11 +533,11 @@ - (void)dzn_reloadEmptyDataSet view.userInteractionEnabled = [self dzn_isTouchAllowed]; [view setupConstraints]; - if (@available(iOS 7.0, *)) { - [UIView performWithoutAnimation:^{ - [view layoutIfNeeded]; - }]; - } + + [UIView performWithoutAnimation:^{ + [view layoutIfNeeded]; + }]; + // Configure scroll permission self.scrollEnabled = [self dzn_isScrollAllowed]; From 46e31f271591b30e21ad6f7c2f3382ddd33bbf1c Mon Sep 17 00:00:00 2001 From: Gareth Miller Date: Thu, 27 Sep 2018 13:14:45 +0100 Subject: [PATCH 4/4] Used weakSelf in place of self-> --- Source/UIScrollView+EmptyDataSet.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/UIScrollView+EmptyDataSet.m b/Source/UIScrollView+EmptyDataSet.m index 40ff016b..6d4636ee 100644 --- a/Source/UIScrollView+EmptyDataSet.m +++ b/Source/UIScrollView+EmptyDataSet.m @@ -740,7 +740,8 @@ - (void)didMoveToSuperview CGRect superviewBounds = self.superview.bounds; self.frame = CGRectMake(0.0, 0.0, CGRectGetWidth(superviewBounds), CGRectGetHeight(superviewBounds)); - void(^fadeInBlock)(void) = ^{self->_contentView.alpha = 1.0;}; + __weak __typeof(_contentView) weakContentView = _contentView; + void(^fadeInBlock)(void) = ^{weakContentView.alpha = 1.0;}; if (self.fadeInOnDisplay) { [UIView animateWithDuration:0.25