|
|
@@ -8,6 +8,7 @@
|
|
|
//
|
|
|
|
|
|
#import "MJRefreshFooter.h"
|
|
|
+#include "UIScrollView+MJRefresh.h"
|
|
|
|
|
|
@interface MJRefreshFooter()
|
|
|
|
|
|
@@ -75,4 +76,20 @@ - (void)resetNoMoreData
|
|
|
self.state = MJRefreshStateIdle;
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
+- (void)setAutomaticallyHidden:(BOOL)automaticallyHidden
|
|
|
+{
|
|
|
+ _automaticallyHidden = automaticallyHidden;
|
|
|
+
|
|
|
+ if (automaticallyHidden) {
|
|
|
+#pragma clang diagnostic push
|
|
|
+#pragma clang diagnostic ignored "-Wundeclared-selector"
|
|
|
+ static dispatch_once_t onceToken;
|
|
|
+ dispatch_once(&onceToken, ^{
|
|
|
+ [UITableView exchangeInstanceMethod1:@selector(reloadData) method2:@selector(mj_reloadData)];
|
|
|
+ [UICollectionView exchangeInstanceMethod1:@selector(reloadData) method2:@selector(mj_reloadData)];
|
|
|
+ });
|
|
|
+#pragma clang diagnostic pop
|
|
|
+ }
|
|
|
+}
|
|
|
@end
|