Skip to content
This repository was archived by the owner on Aug 24, 2019. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions SSPullToRefresh/SSPullToRefreshDefaultContentView.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@

#import "SSPullToRefreshView.h"

NS_ASSUME_NONNULL_BEGIN

@interface SSPullToRefreshDefaultContentView : UIView <SSPullToRefreshContentView>

@property (nonatomic, readonly) UILabel *statusLabel;
@property (nonatomic, readonly) UILabel *lastUpdatedAtLabel;
@property (nonatomic, readonly) UIActivityIndicatorView *activityIndicatorView;

@end

NS_ASSUME_NONNULL_END
4 changes: 4 additions & 0 deletions SSPullToRefresh/SSPullToRefreshSimpleContentView.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@

#import "SSPullToRefreshView.h"

NS_ASSUME_NONNULL_BEGIN

@interface SSPullToRefreshSimpleContentView : UIView <SSPullToRefreshContentView>

@property (nonatomic, readonly) UILabel *statusLabel;
@property (nonatomic, readonly) UIActivityIndicatorView *activityIndicatorView;

@end

NS_ASSUME_NONNULL_END
12 changes: 8 additions & 4 deletions SSPullToRefresh/SSPullToRefreshView.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ typedef NS_ENUM(NSUInteger, SSPullToRefreshViewStyle) {
@protocol SSPullToRefreshViewDelegate;
@protocol SSPullToRefreshContentView;

NS_ASSUME_NONNULL_BEGIN

@interface SSPullToRefreshView : UIView

/**
Expand Down Expand Up @@ -105,15 +107,15 @@ typedef NS_ENUM(NSUInteger, SSPullToRefreshViewStyle) {

@see initWithScrollView:delegate:
*/
@property (nonatomic, assign, readonly) UIScrollView *scrollView;
@property (nonatomic, unsafe_unretained, readonly, nullable) UIScrollView *scrollView;

/**
The delegate is sent messages when the pull to refresh view starts loading. This is automatically set with `initWithScrollView:delegate:`.

@see initWithScrollView:delegate:
@see SSPullToRefreshViewDelegate
*/
@property (nonatomic, weak) id<SSPullToRefreshViewDelegate> delegate;
@property (nonatomic, weak, nullable) id<SSPullToRefreshViewDelegate> delegate;

/**
The state of the pull to refresh view.
Expand Down Expand Up @@ -156,13 +158,13 @@ typedef NS_ENUM(NSUInteger, SSPullToRefreshViewStyle) {
animate down the pull to refresh view to show that it's loading.
*/
- (void)startLoadingAndExpand:(BOOL)shouldExpand animated:(BOOL)animated;
- (void)startLoadingAndExpand:(BOOL)shouldExpand animated:(BOOL)animated completion:(void(^)(void))block;
- (void)startLoadingAndExpand:(BOOL)shouldExpand animated:(BOOL)animated completion:(nullable void(^)(void))block;

/**
Call this when you finish loading.
*/
- (void)finishLoading;
- (void)finishLoadingAnimated:(BOOL)animated completion:(void(^)(void))block;
- (void)finishLoadingAnimated:(BOOL)animated completion:(nullable void(^)(void))block;

/**
Manually update the last updated at time. This will automatically get called when the pull to refresh view finishes laoding.
Expand Down Expand Up @@ -240,3 +242,5 @@ typedef NS_ENUM(NSUInteger, SSPullToRefreshViewStyle) {
- (void)setLastUpdatedAt:(NSDate *)date withPullToRefreshView:(SSPullToRefreshView *)view;

@end

NS_ASSUME_NONNULL_END