|
|
@@ -54,6 +54,11 @@ - (MJRefreshFooterView *)footer {
|
|
|
* @param callback 回调
|
|
|
*/
|
|
|
- (void)addHeaderWithCallback:(void (^)())callback
|
|
|
+{
|
|
|
+ [self addHeaderWithCallback:callback dateKey:nil];
|
|
|
+}
|
|
|
+
|
|
|
+- (void)addHeaderWithCallback:(void (^)())callback dateKey:(NSString*)dateKey
|
|
|
{
|
|
|
// 1.创建新的header
|
|
|
if (!self.header) {
|
|
|
@@ -64,11 +69,8 @@ - (void)addHeaderWithCallback:(void (^)())callback
|
|
|
|
|
|
// 2.设置block回调
|
|
|
self.header.beginRefreshingCallback = callback;
|
|
|
-}
|
|
|
-
|
|
|
-- (void)addHeaderWithCallback:(void (^)())callback dateKey:(NSString*)dateKey
|
|
|
-{
|
|
|
- [self addHeaderWithCallback:callback];
|
|
|
+
|
|
|
+ // 3.设置存储刷新时间的key
|
|
|
self.header.dateKey = dateKey;
|
|
|
}
|
|
|
|
|
|
@@ -79,6 +81,11 @@ - (void)addHeaderWithCallback:(void (^)())callback dateKey:(NSString*)dateKey
|
|
|
* @param action 回调方法
|
|
|
*/
|
|
|
- (void)addHeaderWithTarget:(id)target action:(SEL)action
|
|
|
+{
|
|
|
+ [self addHeaderWithTarget:target action:action dateKey:nil];
|
|
|
+}
|
|
|
+
|
|
|
+- (void)addHeaderWithTarget:(id)target action:(SEL)action dateKey:(NSString*)dateKey
|
|
|
{
|
|
|
// 1.创建新的header
|
|
|
if (!self.header) {
|
|
|
@@ -90,11 +97,8 @@ - (void)addHeaderWithTarget:(id)target action:(SEL)action
|
|
|
// 2.设置目标和回调方法
|
|
|
self.header.beginRefreshingTaget = target;
|
|
|
self.header.beginRefreshingAction = action;
|
|
|
-}
|
|
|
-
|
|
|
-- (void)addHeaderWithTarget:(id)target action:(SEL)action dateKey:(NSString*)dateKey
|
|
|
-{
|
|
|
- [self addHeaderWithTarget:target action:action];
|
|
|
+
|
|
|
+ // 3.设置存储刷新时间的key
|
|
|
self.header.dateKey = dateKey;
|
|
|
}
|
|
|
|