Skip to content

Commit 89e2943

Browse files
committed
Modernize syntax
1 parent 6a2875c commit 89e2943

File tree

2 files changed

+23
-10
lines changed

2 files changed

+23
-10
lines changed

INSPullToRefresh/INSInfiniteScrollBackgroundView.h

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525

2626
#import <UIKit/UIKit.h>
2727

28+
NS_ASSUME_NONNULL_BEGIN
29+
2830
typedef void(^INSInfinityScrollActionHandler)(UIScrollView *scrollView);
2931

3032
typedef NS_ENUM(NSUInteger, INSInfiniteScrollBackgroundViewState) {
@@ -35,17 +37,21 @@ typedef NS_ENUM(NSUInteger, INSInfiniteScrollBackgroundViewState) {
3537
@class INSInfiniteScrollBackgroundView;
3638

3739
@protocol INSInfiniteScrollBackgroundViewDelegate <NSObject>
40+
3841
@optional
42+
3943
- (void)infinityScrollBackgroundView:(INSInfiniteScrollBackgroundView *)infinityScrollBackgroundView didChangeState:(INSInfiniteScrollBackgroundViewState)state;
44+
4045
@end
4146

4247
@interface INSInfiniteScrollBackgroundView : UIView
43-
@property (nonatomic, copy) INSInfinityScrollActionHandler actionHandler;
44-
@property (nonatomic, weak, readonly) UIScrollView *scrollView;
4548

46-
@property (nonatomic, weak) id <INSInfiniteScrollBackgroundViewDelegate> delegate;
49+
@property (nonatomic, copy, nullable) INSInfinityScrollActionHandler actionHandler;
50+
@property (nonatomic, weak, readonly, nullable) UIScrollView *scrollView;
4751

48-
@property (nonatomic, readonly) INSInfiniteScrollBackgroundViewState state;
52+
@property (nonatomic, weak, nullable) id <INSInfiniteScrollBackgroundViewDelegate> delegate;
53+
54+
@property (nonatomic, assign, readonly) INSInfiniteScrollBackgroundViewState state;
4955
@property (nonatomic, assign) BOOL preserveContentInset;
5056

5157
@property (nonatomic, assign) BOOL enabled;
@@ -55,9 +61,12 @@ typedef NS_ENUM(NSUInteger, INSInfiniteScrollBackgroundViewState) {
5561

5662
@property (nonatomic, assign) CGFloat additionalBottomOffsetForInfinityScrollTrigger;
5763

58-
- (instancetype)initWithHeight:(CGFloat)height scrollView:(UIScrollView *)scrollView;
64+
- (instancetype)initWithHeight:(CGFloat)height scrollView:(nullable UIScrollView *)scrollView;
5965

6066
- (void)beginInfiniteScrolling;
6167
- (void)endInfiniteScrolling;
6268
- (void)endInfiniteScrollingWithStoppingContentOffset:(BOOL)stopContentOffset;
69+
6370
@end
71+
72+
NS_ASSUME_NONNULL_END

INSPullToRefresh/INSPullToRefreshBackgroundView.h

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525

2626
#import <UIKit/UIKit.h>
2727

28+
NS_ASSUME_NONNULL_BEGIN
29+
2830
extern CGFloat const INSPullToRefreshDefaultResetContentInsetAnimationTime;
2931
extern CGFloat const INSPullToRefreshDefaultDragToTriggerOffset;
3032

@@ -48,12 +50,12 @@ typedef NS_ENUM(NSUInteger, INSPullToRefreshBackgroundViewState) {
4850

4951
@interface INSPullToRefreshBackgroundView : UIView
5052

51-
@property (nonatomic, copy) INSPullToRefreshActionHandler actionHandler;
52-
@property (nonatomic, weak, readonly) UIScrollView *scrollView;
53+
@property (nonatomic, copy, nullable) INSPullToRefreshActionHandler actionHandler;
54+
@property (nonatomic, weak, readonly, nullable) UIScrollView *scrollView;
5355

54-
@property (nonatomic, weak) id <INSPullToRefreshBackgroundViewDelegate> delegate;
56+
@property (nonatomic, weak, nullable) id <INSPullToRefreshBackgroundViewDelegate> delegate;
5557

56-
@property (nonatomic, readonly) INSPullToRefreshBackgroundViewState state;
58+
@property (nonatomic, assign, readonly) INSPullToRefreshBackgroundViewState state;
5759
@property (nonatomic, assign) BOOL preserveContentInset;
5860
@property (nonatomic, assign) BOOL scrollToTopAfterEndRefreshing;
5961
@property (nonatomic, assign) BOOL shouldResetContentInsetDuringRotation; // Default YES
@@ -64,9 +66,11 @@ typedef NS_ENUM(NSUInteger, INSPullToRefreshBackgroundViewState) {
6466

6567
@property (nonatomic, assign) BOOL enabled;
6668

67-
- (instancetype)initWithHeight:(CGFloat)height scrollView:(UIScrollView *)scrollView;
69+
- (instancetype)initWithHeight:(CGFloat)height scrollView:(nullable UIScrollView *)scrollView;
6870

6971
- (void)beginRefreshing;
7072
- (void)endRefreshing;
7173

7274
@end
75+
76+
NS_ASSUME_NONNULL_END

0 commit comments

Comments
 (0)