2
0
Эх сурвалжийг харах

Make interface more restrict

Such as removing weak from readonly property
MJLee 11 жил өмнө
parent
commit
571135fd01

+ 2 - 2
MJRefresh.podspec

@@ -1,12 +1,12 @@
 Pod::Spec.new do |s|
   s.name         = "MJRefresh"
-  s.version      = "1.3.4"
+  s.version      = "1.3.5"
   s.summary      = "The easiest way to use pull-to-refresh"
   s.homepage     = "https://github.com/CoderMJLee/MJRefresh"
   s.license      = "MIT"
   s.authors      = { 'MJ Lee' => '199109106@qq.com'}
   s.platform     = :ios, "6.0"
-  s.source       = { :git => "https://github.com/CoderMJLee/MJRefresh.git", :tag => "1.3.4" }
+  s.source       = { :git => "https://github.com/CoderMJLee/MJRefresh.git", :tag => "1.3.5" }
   s.source_files = "MJRefreshExample/MJRefreshExample/MJRefresh/*.{h,m}"
   s.resource     = "MJRefreshExample/MJRefreshExample/MJRefresh/MJRefresh.bundle"
   s.requires_arc = true

+ 4 - 6
MJRefreshExample/MJRefreshExample/Classes/MJCollectionViewController.m

@@ -32,8 +32,7 @@ - (void)example21
     __weak typeof(self) weakSelf = self;
     
     // 下拉刷新
-    [self.collectionView addLegendHeader];
-    self.collectionView.header.refreshingBlock = ^{
+    [self.collectionView addLegendHeaderWithRefreshingBlock:^{
         // 增加5条假数据
         for (int i = 0; i<10; i++) {
             [weakSelf.colors insertObject:MJRandomColor atIndex:0];
@@ -46,12 +45,11 @@ - (void)example21
             // 结束刷新
             [weakSelf.collectionView.header endRefreshing];
         });
-    };
+    }];
     [self.collectionView.header beginRefreshing];
     
     // 上拉刷新
-    [self.collectionView addLegendFooter];
-    self.collectionView.footer.refreshingBlock = ^{
+     [self.collectionView addLegendFooterWithRefreshingBlock:^{
         // 增加5条假数据
         for (int i = 0; i<5; i++) {
             [weakSelf.colors addObject:MJRandomColor];
@@ -64,7 +62,7 @@ - (void)example21
             // 结束刷新
             [weakSelf.collectionView.footer endRefreshing];
         });
-    };
+    }];
     // 默认先隐藏footer
     self.collectionView.footer.hidden = YES;
 }

+ 4 - 20
MJRefreshExample/MJRefreshExample/MJRefresh/UIScrollView+MJRefresh.h

@@ -18,15 +18,11 @@
 /** 下拉刷新控件 */
 @property (weak, nonatomic, readonly) MJRefreshHeader *header;
 /** gif功能的下拉刷新控件 */
-@property (weak, nonatomic, readonly) MJRefreshGifHeader *gifHeader;
+@property (nonatomic, readonly) MJRefreshGifHeader *gifHeader;
 /** 传统的下拉刷新控件 */
-@property (weak, nonatomic, readonly) MJRefreshLegendHeader *legendHeader;
+@property (nonatomic, readonly) MJRefreshLegendHeader *legendHeader;
 
 #pragma mark - 添加下拉刷新控件
-/**
- * 添加一个传统的下拉刷新控件
- */
-- (MJRefreshLegendHeader *)addLegendHeader;
 /**
  * 添加一个传统的下拉刷新控件
  *
@@ -55,10 +51,6 @@
  * @param dateKey   用来记录刷新时间的key
  */
 - (MJRefreshLegendHeader *)addLegendHeaderWithRefreshingTarget:(id)target refreshingAction:(SEL)action dateKey:(NSString *)dateKey;
-/**
- * 添加一个gif图片的下拉刷新控件
- */
-- (MJRefreshGifHeader *)addGifHeader;
 /**
  * 添加一个gif图片的下拉刷新控件
  *
@@ -98,15 +90,11 @@
 /** 上拉刷新控件 */
 @property (weak, nonatomic, readonly) MJRefreshFooter *footer;
 /** gif功能的上拉刷新控件 */
-@property (weak, nonatomic, readonly) MJRefreshGifFooter *gifFooter;
+@property (nonatomic, readonly) MJRefreshGifFooter *gifFooter;
 /** 传统的上拉刷新控件 */
-@property (weak, nonatomic, readonly) MJRefreshLegendFooter *legendFooter;
+@property (nonatomic, readonly) MJRefreshLegendFooter *legendFooter;
 
 #pragma mark - 添加上拉刷新控件
-/**
- * 添加一个传统的上拉刷新控件
- */
-- (MJRefreshLegendFooter *)addLegendFooter;
 /**
  * 添加一个传统的上拉刷新控件
  *
@@ -120,10 +108,6 @@
  * @param action 进入刷新状态就会自动调用target对象的action方法
  */
 - (MJRefreshLegendFooter *)addLegendFooterWithRefreshingTarget:(id)target refreshingAction:(SEL)action;
-/**
- * 添加一个gif图片的上拉刷新控件
- */
-- (MJRefreshGifFooter *)addGifFooter;
 /**
  * 添加一个gif图片的上拉刷新控件
  *