Bladeren bron

Revert "Little change"

This reverts commit 0ac4583e802251435c9220ede7a8a3e3a64fab6f.
M了个J 7 jaren geleden
bovenliggende
commit
e3afdd24df
2 gewijzigde bestanden met toevoegingen van 11 en 12 verwijderingen
  1. 0 3
      MJRefresh/Custom/Footer/Back/MJRefreshBackNormalFooter.m
  2. 11 9
      MJRefresh/UIScrollView+MJExtension.m

+ 0 - 3
MJRefresh/Custom/Footer/Back/MJRefreshBackNormalFooter.m

@@ -90,9 +90,6 @@ - (void)setState:(MJRefreshState)state
             [UIView animateWithDuration:MJRefreshSlowAnimationDuration animations:^{
                 self.loadingView.alpha = 0.0;
             } completion:^(BOOL finished) {
-                // 防止动画结束后,状态已经不是MJRefreshStateIdle
-                if (state != MJRefreshStateIdle) return;
-                
                 self.loadingView.alpha = 1.0;
                 [self.loadingView stopAnimating];
                 

+ 11 - 9
MJRefresh/UIScrollView+MJExtension.m

@@ -15,20 +15,22 @@
 
 @implementation UIScrollView (MJExtension)
 
-static BOOL respondsToAdjustedContentInset_;
+static BOOL mj_respondsToAdjustedContentInset;
 
-+ (void)initialize
-{
+- (BOOL)gt_respondsToAdjustedContentInset {
+    
     static dispatch_once_t onceToken;
     dispatch_once(&onceToken, ^{
-        respondsToAdjustedContentInset_ = [self respondsToSelector:@selector(adjustedContentInset)];
+        mj_respondsToAdjustedContentInset = [self respondsToSelector:@selector(adjustedContentInset)];
     });
+    
+    return mj_respondsToAdjustedContentInset;
 }
 
 - (UIEdgeInsets)mj_inset
 {
 #ifdef __IPHONE_11_0
-    if (respondsToAdjustedContentInset_) {
+    if ([self gt_respondsToAdjustedContentInset]) {
         return self.adjustedContentInset;
     }
 #endif
@@ -40,7 +42,7 @@ - (void)setMj_insetT:(CGFloat)mj_insetT
     UIEdgeInsets inset = self.contentInset;
     inset.top = mj_insetT;
 #ifdef __IPHONE_11_0
-    if (respondsToAdjustedContentInset_) {
+    if ([self gt_respondsToAdjustedContentInset]) {
         inset.top -= (self.adjustedContentInset.top - self.contentInset.top);
     }
 #endif
@@ -57,7 +59,7 @@ - (void)setMj_insetB:(CGFloat)mj_insetB
     UIEdgeInsets inset = self.contentInset;
     inset.bottom = mj_insetB;
 #ifdef __IPHONE_11_0
-    if (respondsToAdjustedContentInset_) {
+    if ([self gt_respondsToAdjustedContentInset]) {
         inset.bottom -= (self.adjustedContentInset.bottom - self.contentInset.bottom);
     }
 #endif
@@ -74,7 +76,7 @@ - (void)setMj_insetL:(CGFloat)mj_insetL
     UIEdgeInsets inset = self.contentInset;
     inset.left = mj_insetL;
 #ifdef __IPHONE_11_0
-    if (respondsToAdjustedContentInset_) {
+    if ([self gt_respondsToAdjustedContentInset]) {
         inset.left -= (self.adjustedContentInset.left - self.contentInset.left);
     }
 #endif
@@ -91,7 +93,7 @@ - (void)setMj_insetR:(CGFloat)mj_insetR
     UIEdgeInsets inset = self.contentInset;
     inset.right = mj_insetR;
 #ifdef __IPHONE_11_0
-    if (respondsToAdjustedContentInset_) {
+    if ([self gt_respondsToAdjustedContentInset]) {
         inset.right -= (self.adjustedContentInset.right - self.contentInset.right);
     }
 #endif