From 31dd778c9bd286185ab4546b53c5ea3a81d79cfb Mon Sep 17 00:00:00 2001 From: Nikita Lutsenko Date: Mon, 16 Feb 2015 21:36:03 +0000 Subject: [PATCH] Add nullability annotations to PFImageView, PFTextField. --- ParseUI/Classes/Views/PFImageView.h | 13 ++++++++++--- ParseUI/Classes/Views/PFTextField.h | 8 +++++++- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/ParseUI/Classes/Views/PFImageView.h b/ParseUI/Classes/Views/PFImageView.h index d8db09d..c0af7ef 100644 --- a/ParseUI/Classes/Views/PFImageView.h +++ b/ParseUI/Classes/Views/PFImageView.h @@ -21,6 +21,10 @@ #import +#import + +PFUI_ASSUME_NONNULL_BEGIN + @class BFTask; @class PFFile; @@ -34,7 +38,7 @@ @warning Note that the download does not start until is called. */ -@property (nonatomic, strong) PFFile *file; +@property (PFUI_NULLABLE_PROPERTY nonatomic, strong) PFFile *file; /*! @abstract Initiate downloading of the remote image. @@ -52,7 +56,7 @@ @param completion the completion block. */ -- (void)loadInBackground:(void (^)(UIImage *image, NSError *error))completion; +- (void)loadInBackground:(PFUI_NULLABLE void (^)(PFUI_NULLABLE_S UIImage *image, PFUI_NULLABLE_S NSError *error))completion; /*! @abstract Initiate downloading of the remote image. @@ -63,6 +67,9 @@ @param progressBlock called with the download progress as the image is being downloaded. Will be called with a value of 100 before the completion block is called. */ -- (void)loadInBackground:(void (^)(UIImage *, NSError *))completion progressBlock:(void (^)(int percentDone))progressBlock; +- (void)loadInBackground:(PFUI_NULLABLE void (^)(PFUI_NULLABLE_S UIImage *image, PFUI_NULLABLE_S NSError *error))completion + progressBlock:(PFUI_NULLABLE void (^)(int percentDone))progressBlock; @end + +PFUI_ASSUME_NONNULL_END diff --git a/ParseUI/Classes/Views/PFTextField.h b/ParseUI/Classes/Views/PFTextField.h index aeafef5..5bfb168 100644 --- a/ParseUI/Classes/Views/PFTextField.h +++ b/ParseUI/Classes/Views/PFTextField.h @@ -21,6 +21,10 @@ #import +#import + +PFUI_ASSUME_NONNULL_BEGIN + /*! `PFTextFieldSeparatorStyle` bitmask specifies the style of the separators, that should be used for a given `PFTextField`. @@ -56,7 +60,7 @@ typedef NS_OPTIONS(uint8_t, PFTextFieldSeparatorStyle){ @discussion Default: `227,227,227,1.0`. */ -@property (nonatomic, strong) UIColor *separatorColor UI_APPEARANCE_SELECTOR; +@property (PFUI_NULLABLE_PROPERTY nonatomic, strong) UIColor *separatorColor UI_APPEARANCE_SELECTOR; /*! This method is a convenience initializer that sets both `frame` and `separatorStyle` for an instance of `PFTextField.` @@ -69,3 +73,5 @@ typedef NS_OPTIONS(uint8_t, PFTextFieldSeparatorStyle){ - (instancetype)initWithFrame:(CGRect)frame separatorStyle:(PFTextFieldSeparatorStyle)separatorStyle; @end + +PFUI_ASSUME_NONNULL_END