diff --git a/MJRefresh.podspec b/MJRefresh.podspec index 41a008ac..9ee6d711 100644 --- a/MJRefresh.podspec +++ b/MJRefresh.podspec @@ -1,13 +1,13 @@ Pod::Spec.new do |s| s.name = 'MJRefresh' - s.version = '3.1.15' + s.version = '3.1.15.1' s.summary = 'An easy way to use pull-to-refresh' s.homepage = 'https://github.com/CoderMJLee/MJRefresh' s.license = 'MIT' - s.authors = {'MJ Lee' => '199109106@qq.com'} + s.authors = {'MJ Lee' => 'richermj123go@vip.qq.com'} s.platform = :ios, '6.0' s.source = {:git => 'https://github.com/CoderMJLee/MJRefresh.git', :tag => s.version} - s.source_files = 'MJRefresh/**/*.{h,m}' + s.source_files = 'MJRefresh/*.{h,m}' s.resource = 'MJRefresh/MJRefresh.bundle' s.requires_arc = true end diff --git a/MJRefresh/Base/MJRefreshFooter.m b/MJRefresh/Base/MJRefreshFooter.m index 75ba9aaa..7b4e14ce 100644 --- a/MJRefresh/Base/MJRefreshFooter.m +++ b/MJRefresh/Base/MJRefreshFooter.m @@ -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 diff --git a/MJRefresh/Base/MJRefreshHeader.m b/MJRefresh/Base/MJRefreshHeader.m index 3769f416..19dd1e1c 100644 --- a/MJRefresh/Base/MJRefreshHeader.m +++ b/MJRefresh/Base/MJRefreshHeader.m @@ -54,7 +54,7 @@ - (void)scrollViewContentOffsetDidChange:(NSDictionary *)change // 在刷新的refreshing状态 if (self.state == MJRefreshStateRefreshing) { - if (self.window == nil) return; +// if (self.window == nil) return; // sectionheader停留解决 CGFloat insetT = - self.scrollView.mj_offsetY > _scrollViewOriginalInset.top ? - self.scrollView.mj_offsetY : _scrollViewOriginalInset.top; diff --git a/MJRefresh/UIScrollView+MJRefresh.h b/MJRefresh/UIScrollView+MJRefresh.h index 17d47153..5da030f0 100644 --- a/MJRefresh/UIScrollView+MJRefresh.h +++ b/MJRefresh/UIScrollView+MJRefresh.h @@ -12,6 +12,11 @@ @class MJRefreshHeader, MJRefreshFooter; +@interface NSObject (MJRefresh) ++ (void)exchangeInstanceMethod1:(SEL)method1 method2:(SEL)method2; ++ (void)exchangeClassMethod1:(SEL)method1 method2:(SEL)method2; +@end + @interface UIScrollView (MJRefresh) /** 下拉刷新控件 */ @property (strong, nonatomic) MJRefreshHeader *mj_header; diff --git a/MJRefresh/UIScrollView+MJRefresh.m b/MJRefresh/UIScrollView+MJRefresh.m index b1b99426..316263d1 100644 --- a/MJRefresh/UIScrollView+MJRefresh.m +++ b/MJRefresh/UIScrollView+MJRefresh.m @@ -134,11 +134,6 @@ - (void)executeReloadDataBlock @implementation UITableView (MJRefresh) -+ (void)load -{ - [self exchangeInstanceMethod1:@selector(reloadData) method2:@selector(mj_reloadData)]; -} - - (void)mj_reloadData { [self mj_reloadData]; @@ -149,11 +144,6 @@ - (void)mj_reloadData @implementation UICollectionView (MJRefresh) -+ (void)load -{ - [self exchangeInstanceMethod1:@selector(reloadData) method2:@selector(mj_reloadData)]; -} - - (void)mj_reloadData { [self mj_reloadData]; diff --git a/MJRefreshExample/Classes/Second/MJTableViewController.m b/MJRefreshExample/Classes/Second/MJTableViewController.m index 3be9ed79..172797d5 100644 --- a/MJRefreshExample/Classes/Second/MJTableViewController.m +++ b/MJRefreshExample/Classes/Second/MJTableViewController.m @@ -185,7 +185,6 @@ - (void)example14 - (void)reset { [self.tableView.mj_footer setRefreshingTarget:self refreshingAction:@selector(loadMoreData)]; -// [self.tableView.mj_footer beginRefreshing]; [self.tableView.mj_footer resetNoMoreData]; } diff --git a/MJRefreshExample/Images.xcassets/AppIcon.appiconset/Contents.json b/MJRefreshExample/Images.xcassets/AppIcon.appiconset/Contents.json index 7da96044..40f32c61 100644 --- a/MJRefreshExample/Images.xcassets/AppIcon.appiconset/Contents.json +++ b/MJRefreshExample/Images.xcassets/AppIcon.appiconset/Contents.json @@ -1,5 +1,15 @@ { "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, { "idiom" : "iphone", "size" : "29x29", @@ -31,6 +41,16 @@ "size" : "60x60", "scale" : "3x" }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, { "idiom" : "ipad", "size" : "29x29", @@ -65,6 +85,11 @@ "idiom" : "ipad", "size" : "83.5x83.5", "scale" : "2x" + }, + { + "idiom" : "ios-marketing", + "size" : "1024x1024", + "scale" : "1x" } ], "info" : {