Skip to content
This repository has been archived by the owner on Jan 16, 2021. It is now read-only.

Commit

Permalink
Add nullability annotations to PFImageView, PFTextField.
Browse files Browse the repository at this point in the history
  • Loading branch information
nlutsenko committed Feb 16, 2015
1 parent afeaae7 commit 6fc1c09
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
11 changes: 7 additions & 4 deletions ParseUI/Classes/Views/PFImageView.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

#import <UIKit/UIKit.h>

#import <ParseUI/ParseUIConstants.h>

@class BFTask;
@class PFFile;

Expand All @@ -34,7 +36,7 @@
@warning Note that the download does not start until <loadInBackground:> is called.
*/
@property (nonatomic, strong) PFFile *file;
@property (nonatomic, strong, nullable) PFFile *file;

/*!
@abstract Initiate downloading of the remote image.
Expand All @@ -43,7 +45,7 @@
@returns The task, that encapsulates the work being done.
*/
- (BFTask *)loadInBackground;
- (nonnull BFTask *)loadInBackground;

/*!
@abstract Initiate downloading of the remote image.
Expand All @@ -52,7 +54,7 @@
@param completion the completion block.
*/
- (void)loadInBackground:(void (^)(UIImage *image, NSError *error))completion;
- (void)loadInBackground:(nullable void (^)(__nullable UIImage *image, __nullable NSError *error))completion;

/*!
@abstract Initiate downloading of the remote image.
Expand All @@ -63,6 +65,7 @@
@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:(nullable void (^)(__nullable UIImage *image, __nullable NSError *error))completion
progressBlock:(nullable void (^)(int percentDone))progressBlock;

@end
6 changes: 4 additions & 2 deletions ParseUI/Classes/Views/PFTextField.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

#import <UIKit/UIKit.h>

#import <ParseUI/ParseUIConstants.h>

/*!
`PFTextFieldSeparatorStyle` bitmask specifies the style of the separators,
that should be used for a given `PFTextField`.
Expand Down Expand Up @@ -56,7 +58,7 @@ typedef NS_OPTIONS(uint8_t, PFTextFieldSeparatorStyle){
@discussion Default: `227,227,227,1.0`.
*/
@property (nonatomic, strong) UIColor *separatorColor UI_APPEARANCE_SELECTOR;
@property (nonatomic, strong, nullable) UIColor *separatorColor UI_APPEARANCE_SELECTOR;

/*!
This method is a convenience initializer that sets both `frame` and `separatorStyle` for an instance of `PFTextField.`
Expand All @@ -66,6 +68,6 @@ typedef NS_OPTIONS(uint8_t, PFTextFieldSeparatorStyle){
@return An initialized instance of `PFTextField` or `nil` if it couldn't be created.
*/
- (instancetype)initWithFrame:(CGRect)frame separatorStyle:(PFTextFieldSeparatorStyle)separatorStyle;
- (nonnull instancetype)initWithFrame:(CGRect)frame separatorStyle:(PFTextFieldSeparatorStyle)separatorStyle;

@end

0 comments on commit 6fc1c09

Please sign in to comment.