Selaa lähdekoodia

Merge pull request #1 from CoderMJLee/master

remove @available and warnings
Russell Yi 8 vuotta sitten
vanhempi
commit
932033a9a8

+ 1 - 1
MJRefresh.podspec

@@ -1,6 +1,6 @@
 Pod::Spec.new do |s|
     s.name         = 'MJRefresh'
-    s.version      = '3.1.14'
+    s.version      = '3.1.14.1'
     s.summary      = 'An easy way to use pull-to-refresh'
     s.homepage     = 'https://github.com/CoderMJLee/MJRefresh'
     s.license      = 'MIT'

+ 5 - 5
MJRefresh/Base/MJRefreshComponent.h

@@ -29,11 +29,11 @@ typedef NS_ENUM(NSInteger, MJRefreshState) {
 };
 
 /** 进入刷新状态的回调 */
-typedef void (^MJRefreshComponentRefreshingBlock)();
+typedef void (^MJRefreshComponentRefreshingBlock)(void);
 /** 开始刷新后的回调(进入刷新状态后的回调) */
-typedef void (^MJRefreshComponentbeginRefreshingCompletionBlock)();
+typedef void (^MJRefreshComponentbeginRefreshingCompletionBlock)(void);
 /** 结束刷新后的回调 */
-typedef void (^MJRefreshComponentEndRefreshingCompletionBlock)();
+typedef void (^MJRefreshComponentEndRefreshingCompletionBlock)(void);
 
 /** 刷新控件的基类 */
 @interface MJRefreshComponent : UIView
@@ -59,14 +59,14 @@ typedef void (^MJRefreshComponentEndRefreshingCompletionBlock)();
 #pragma mark - 刷新状态控制
 /** 进入刷新状态 */
 - (void)beginRefreshing;
-- (void)beginRefreshingWithCompletionBlock:(void (^)())completionBlock;
+- (void)beginRefreshingWithCompletionBlock:(void (^)(void))completionBlock;
 /** 开始刷新后的回调(进入刷新状态后的回调) */
 @property (copy, nonatomic) MJRefreshComponentbeginRefreshingCompletionBlock beginRefreshingCompletionBlock;
 /** 结束刷新的回调 */
 @property (copy, nonatomic) MJRefreshComponentEndRefreshingCompletionBlock endRefreshingCompletionBlock;
 /** 结束刷新状态 */
 - (void)endRefreshing;
-- (void)endRefreshingWithCompletionBlock:(void (^)())completionBlock;
+- (void)endRefreshingWithCompletionBlock:(void (^)(void))completionBlock;
 /** 是否正在刷新 */
 @property (assign, nonatomic, readonly, getter=isRefreshing) BOOL refreshing;
 //- (BOOL)isRefreshing;

+ 2 - 2
MJRefresh/Base/MJRefreshComponent.m

@@ -161,7 +161,7 @@ - (void)beginRefreshing
     }
 }
 
-- (void)beginRefreshingWithCompletionBlock:(void (^)())completionBlock
+- (void)beginRefreshingWithCompletionBlock:(void (^)(void))completionBlock
 {
     self.beginRefreshingCompletionBlock = completionBlock;
     
@@ -174,7 +174,7 @@ - (void)endRefreshing
     self.state = MJRefreshStateIdle;
 }
 
-- (void)endRefreshingWithCompletionBlock:(void (^)())completionBlock
+- (void)endRefreshingWithCompletionBlock:(void (^)(void))completionBlock
 {
     self.endRefreshingCompletionBlock = completionBlock;
     

+ 9 - 6
MJRefresh/UIScrollView+MJExtension.m

@@ -10,15 +10,17 @@
 #import "UIScrollView+MJExtension.h"
 #import <objc/runtime.h>
 
-#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v)  ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
+#define SYSTEM_VERSION_GREATER_NOT_LESS_THAN(v)  ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
 
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wunguarded-availability-new"
 
 @implementation UIScrollView (MJExtension)
 
 - (UIEdgeInsets)mj_inset
 {
 #ifdef __IPHONE_11_0
-    if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"11.0")) {
+    if (SYSTEM_VERSION_GREATER_NOT_LESS_THAN(@"11.0")) {
         return self.adjustedContentInset;
     }
 #endif
@@ -30,7 +32,7 @@ - (void)setMj_insetT:(CGFloat)mj_insetT
     UIEdgeInsets inset = self.contentInset;
     inset.top = mj_insetT;
 #ifdef __IPHONE_11_0
-    if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"11.0")) {
+    if (SYSTEM_VERSION_GREATER_NOT_LESS_THAN(@"11.0")) {
         inset.top -= (self.adjustedContentInset.top - self.contentInset.top);
     }
 #endif
@@ -47,7 +49,7 @@ - (void)setMj_insetB:(CGFloat)mj_insetB
     UIEdgeInsets inset = self.contentInset;
     inset.bottom = mj_insetB;
 #ifdef __IPHONE_11_0
-    if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"11.0")) {
+    if (SYSTEM_VERSION_GREATER_NOT_LESS_THAN(@"11.0")) {
         inset.bottom -= (self.adjustedContentInset.bottom - self.contentInset.bottom);
     }
 #endif
@@ -64,7 +66,7 @@ - (void)setMj_insetL:(CGFloat)mj_insetL
     UIEdgeInsets inset = self.contentInset;
     inset.left = mj_insetL;
 #ifdef __IPHONE_11_0
-    if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"11.0")) {
+    if (SYSTEM_VERSION_GREATER_NOT_LESS_THAN(@"11.0")) {
         inset.left -= (self.adjustedContentInset.left - self.contentInset.left);
     }
 #endif
@@ -81,7 +83,7 @@ - (void)setMj_insetR:(CGFloat)mj_insetR
     UIEdgeInsets inset = self.contentInset;
     inset.right = mj_insetR;
 #ifdef __IPHONE_11_0
-    if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"11.0")) {
+    if (SYSTEM_VERSION_GREATER_NOT_LESS_THAN(@"11.0")) {
         inset.right -= (self.adjustedContentInset.right - self.contentInset.right);
     }
 #endif
@@ -141,3 +143,4 @@ - (CGFloat)mj_contentH
     return self.contentSize.height;
 }
 @end
+#pragma clang diagnostic pop

+ 1 - 1
MJRefreshExample.xcodeproj/project.pbxproj

@@ -64,7 +64,7 @@
 		2D9DF47B1F7CE2F90042D6DD /* MJRefreshNormalHeader.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DB2EA0A1BECBE6700D58F6A /* MJRefreshNormalHeader.m */; };
 		2D9DF47C1F7CE2F90042D6DD /* MJRefreshStateHeader.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DB2EA0C1BECBE6700D58F6A /* MJRefreshStateHeader.m */; };
 		2D9DF47D1F7CE2F90042D6DD /* MJRefreshConst.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DB2EA101BECBE6700D58F6A /* MJRefreshConst.m */; };
-		2D9DF47E1F7CE2F90042D6DD /* UIScrollView+MJExtension.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DB2EA121BECBE6700D58F6A /* UIScrollView+MJExtension.m */; };
+		2D9DF47E1F7CE2F90042D6DD /* UIScrollView+MJExtension.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DB2EA121BECBE6700D58F6A /* UIScrollView+MJExtension.m */; settings = {COMPILER_FLAGS = "-Wno-unguarded-availability-new"; }; };
 		2D9DF47F1F7CE2F90042D6DD /* UIScrollView+MJRefresh.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DB2EA141BECBE6700D58F6A /* UIScrollView+MJRefresh.m */; };
 		2D9DF4801F7CE2F90042D6DD /* UIView+MJExtension.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DB2EA161BECBE6700D58F6A /* UIView+MJExtension.m */; };
 		2D9DF4811F7CE2F90042D6DD /* NSBundle+MJRefresh.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D4698851D0EE6A400CB8025 /* NSBundle+MJRefresh.m */; };