From e0fd6532591b84c678fb342b471239351bdce051 Mon Sep 17 00:00:00 2001 From: Nikita Lutsenko Date: Wed, 4 Nov 2015 16:12:50 +0200 Subject: [PATCH] Replace nullability macros with generic annotations. --- ParseUI/Classes/Cells/PFCollectionViewCell.h | 6 ++-- .../Classes/Cells/PFPurchaseTableViewCell.h | 8 ++--- ParseUI/Classes/Cells/PFTableViewCell.h | 6 ++-- .../Classes/LogInViewController/PFLogInView.h | 28 +++++++-------- .../PFLogInViewController.h | 14 ++++---- .../PFProductTableViewController.h | 4 +-- .../PFQueryCollectionViewController.h | 24 ++++++------- .../PFQueryTableViewController.h | 36 +++++++++---------- .../SignUpViewController/PFSignUpView.h | 20 +++++------ .../PFSignUpViewController.h | 10 +++--- ParseUI/Classes/Views/PFImageView.h | 14 ++++---- ParseUI/Classes/Views/PFTextField.h | 6 ++-- ParseUI/Other/ParseUIConstants.h | 32 ----------------- 13 files changed, 88 insertions(+), 120 deletions(-) diff --git a/ParseUI/Classes/Cells/PFCollectionViewCell.h b/ParseUI/Classes/Cells/PFCollectionViewCell.h index 71b3642..13d7570 100644 --- a/ParseUI/Classes/Cells/PFCollectionViewCell.h +++ b/ParseUI/Classes/Cells/PFCollectionViewCell.h @@ -23,7 +23,7 @@ #import -PFUI_ASSUME_NONNULL_BEGIN +NS_ASSUME_NONNULL_BEGIN @class PFImageView; @class PFObject; @@ -54,8 +54,8 @@ PFUI_ASSUME_NONNULL_BEGIN @param object An instance of `PFObject` to update from. */ -- (void)updateFromObject:(PFUI_NULLABLE PFObject *)object; +- (void)updateFromObject:(nullable PFObject *)object; @end -PFUI_ASSUME_NONNULL_END +NS_ASSUME_NONNULL_END diff --git a/ParseUI/Classes/Cells/PFPurchaseTableViewCell.h b/ParseUI/Classes/Cells/PFPurchaseTableViewCell.h index eb80487..f954dda 100644 --- a/ParseUI/Classes/Cells/PFPurchaseTableViewCell.h +++ b/ParseUI/Classes/Cells/PFPurchaseTableViewCell.h @@ -24,7 +24,7 @@ #import #import -PFUI_ASSUME_NONNULL_BEGIN +NS_ASSUME_NONNULL_BEGIN /*! An enum that represents states of the PFPurchaseTableViewCell. @@ -56,13 +56,13 @@ typedef NS_ENUM(uint8_t, PFPurchaseTableViewCellState) { /*! @abstract Label where price of the product is displayed. */ -@property (PFUI_NULLABLE_PROPERTY nonatomic, strong, readonly) UILabel *priceLabel; +@property (nullable, nonatomic, strong, readonly) UILabel *priceLabel; /*! @abstract Progress view that is shown, when the product is downloading. */ -@property (PFUI_NULLABLE_PROPERTY nonatomic, strong, readonly) UIProgressView *progressView; +@property (nullable, nonatomic, strong, readonly) UIProgressView *progressView; @end -PFUI_ASSUME_NONNULL_END +NS_ASSUME_NONNULL_END diff --git a/ParseUI/Classes/Cells/PFTableViewCell.h b/ParseUI/Classes/Cells/PFTableViewCell.h index 9238d99..173df06 100644 --- a/ParseUI/Classes/Cells/PFTableViewCell.h +++ b/ParseUI/Classes/Cells/PFTableViewCell.h @@ -24,7 +24,7 @@ #import #import -PFUI_ASSUME_NONNULL_BEGIN +NS_ASSUME_NONNULL_BEGIN /*! The `PFTableViewCell` class represents a table view cell which can download and display remote images stored on Parse. @@ -39,8 +39,8 @@ PFUI_ASSUME_NONNULL_BEGIN @see PFImageView */ -@property (PFUI_NULLABLE_PROPERTY nonatomic, strong, readonly) PFImageView *imageView; +@property (nullable, nonatomic, strong, readonly) PFImageView *imageView; @end -PFUI_ASSUME_NONNULL_END +NS_ASSUME_NONNULL_END diff --git a/ParseUI/Classes/LogInViewController/PFLogInView.h b/ParseUI/Classes/LogInViewController/PFLogInView.h index ee71b02..6f8feec 100644 --- a/ParseUI/Classes/LogInViewController/PFLogInView.h +++ b/ParseUI/Classes/LogInViewController/PFLogInView.h @@ -23,7 +23,7 @@ #import -PFUI_ASSUME_NONNULL_BEGIN +NS_ASSUME_NONNULL_BEGIN /*! `PFLogInFields` bitmask specifies the log in elements which are enabled in the view. @@ -84,14 +84,14 @@ typedef NS_OPTIONS(NSInteger, PFLogInFields) { @discussion Used to lay out elements correctly when the presenting view controller has translucent elements. */ -@property (PFUI_NULLABLE_PROPERTY nonatomic, weak) UIViewController *presentingViewController; +@property (nullable, nonatomic, weak) UIViewController *presentingViewController; ///-------------------------------------- /// @name Customizing the Logo ///-------------------------------------- /// The logo. By default, it is the Parse logo. -@property (PFUI_NULLABLE_PROPERTY nonatomic, strong) UIView *logo; +@property (nullable, nonatomic, strong) UIView *logo; ///-------------------------------------- /// @name Configure Username Behaviour @@ -116,57 +116,57 @@ typedef NS_OPTIONS(NSInteger, PFLogInFields) { /*! @abstract The username text field. It is `nil` if the element is not enabled. */ -@property (PFUI_NULLABLE_PROPERTY nonatomic, strong, readonly) PFTextField *usernameField; +@property (nullable, nonatomic, strong, readonly) PFTextField *usernameField; /*! @abstract The password text field. It is `nil` if the element is not enabled. */ -@property (PFUI_NULLABLE_PROPERTY nonatomic, strong, readonly) PFTextField *passwordField; +@property (nullable, nonatomic, strong, readonly) PFTextField *passwordField; /*! @abstract The password forgotten button. It is `nil` if the element is not enabled. */ -@property (PFUI_NULLABLE_PROPERTY nonatomic, strong, readonly) UIButton *passwordForgottenButton; +@property (nullable, nonatomic, strong, readonly) UIButton *passwordForgottenButton; /*! @abstract The log in button. It is `nil` if the element is not enabled. */ -@property (PFUI_NULLABLE_PROPERTY nonatomic, strong, readonly) UIButton *logInButton; +@property (nullable, nonatomic, strong, readonly) UIButton *logInButton; /*! @abstract The Facebook button. It is `nil` if the element is not enabled. */ -@property (PFUI_NULLABLE_PROPERTY nonatomic, strong, readonly) UIButton *facebookButton; +@property (nullable, nonatomic, strong, readonly) UIButton *facebookButton; /*! @abstract The Twitter button. It is `nil` if the element is not enabled. */ -@property (PFUI_NULLABLE_PROPERTY nonatomic, strong, readonly) UIButton *twitterButton; +@property (nullable, nonatomic, strong, readonly) UIButton *twitterButton; /*! @abstract The sign up button. It is `nil` if the element is not enabled. */ -@property (PFUI_NULLABLE_PROPERTY nonatomic, strong, readonly) UIButton *signUpButton; +@property (nullable, nonatomic, strong, readonly) UIButton *signUpButton; /*! @abstract It is `nil` if the element is not enabled. */ -@property (PFUI_NULLABLE_PROPERTY nonatomic, strong, readonly) UIButton *dismissButton; +@property (nullable, nonatomic, strong, readonly) UIButton *dismissButton; /*! @abstract The facebook/twitter login label. @deprecated This property is deprecated and will always be nil. */ -@property (PFUI_NULLABLE_PROPERTY nonatomic, strong, readonly) UILabel *externalLogInLabel __attribute__(PARSE_UI_DEPRECATED("This property is deprecated and will always be nil.")); +@property (nullable, nonatomic, strong, readonly) UILabel *externalLogInLabel __attribute__(PARSE_UI_DEPRECATED("This property is deprecated and will always be nil.")); /*! @abstract The sign up label. @deprecated This property is deprecated and will always be nil. */ -@property (PFUI_NULLABLE_PROPERTY nonatomic, strong, readonly) UILabel *signUpLabel __attribute__(PARSE_UI_DEPRECATED("This property is deprecated and will always be nil.")); +@property (nullable, nonatomic, strong, readonly) UILabel *signUpLabel __attribute__(PARSE_UI_DEPRECATED("This property is deprecated and will always be nil.")); @end -PFUI_ASSUME_NONNULL_END +NS_ASSUME_NONNULL_END diff --git a/ParseUI/Classes/LogInViewController/PFLogInViewController.h b/ParseUI/Classes/LogInViewController/PFLogInViewController.h index 9df9112..e21a737 100644 --- a/ParseUI/Classes/LogInViewController/PFLogInViewController.h +++ b/ParseUI/Classes/LogInViewController/PFLogInViewController.h @@ -24,7 +24,7 @@ #import #import -PFUI_ASSUME_NONNULL_BEGIN +NS_ASSUME_NONNULL_BEGIN @class PFSignUpViewController; @class PFUser; @@ -52,7 +52,7 @@ PFUI_ASSUME_NONNULL_BEGIN @see PFLogInView */ -@property (PFUI_NULLABLE_PROPERTY nonatomic, strong, readonly) PFLogInView *logInView; +@property (nullable, nonatomic, strong, readonly) PFLogInView *logInView; ///-------------------------------------- /// @name Configuring Log In Behaviors @@ -63,14 +63,14 @@ PFUI_ASSUME_NONNULL_BEGIN @see PFLogInViewControllerDelegate */ -@property (PFUI_NULLABLE_PROPERTY nonatomic, weak) id delegate; +@property (nullable, nonatomic, weak) id delegate; /*! @abstract The facebook permissions that Facebook log in requests for. @discussion If unspecified, the default is basic facebook permissions. */ -@property (PFUI_NULLABLE_PROPERTY nonatomic, copy) NSArray *facebookPermissions; +@property (nullable, nonatomic, copy) NSArray *facebookPermissions; /*! @abstract The sign up controller if sign up is enabled. @@ -78,7 +78,7 @@ PFUI_ASSUME_NONNULL_BEGIN @discussion Use this to configure the sign up view, and the transition animation to the sign up view. The default is a sign up view with a username, a password, a dismiss button and a sign up button. */ -@property (PFUI_NULLABLE_PROPERTY nonatomic, strong) PFSignUpViewController *signUpController; +@property (nullable, nonatomic, strong) PFSignUpViewController *signUpController; /*! @abstract Whether to prompt for the email as username on the login view. @@ -162,7 +162,7 @@ shouldBeginLogInWithUsername:(NSString *)username @param error `NSError` object representing the error that occured. */ - (void)logInViewController:(PFLogInViewController *)logInController - didFailToLogInWithError:(PFUI_NULLABLE NSError *)error; + didFailToLogInWithError:(nullable NSError *)error; /*! @abstract Sent to the delegate when the log in screen is cancelled. @@ -173,4 +173,4 @@ shouldBeginLogInWithUsername:(NSString *)username @end -PFUI_ASSUME_NONNULL_END +NS_ASSUME_NONNULL_END diff --git a/ParseUI/Classes/ProductTableViewController/PFProductTableViewController.h b/ParseUI/Classes/ProductTableViewController/PFProductTableViewController.h index fa5ce55..0cc9654 100644 --- a/ParseUI/Classes/ProductTableViewController/PFProductTableViewController.h +++ b/ParseUI/Classes/ProductTableViewController/PFProductTableViewController.h @@ -24,7 +24,7 @@ #import #import -PFUI_ASSUME_NONNULL_BEGIN +NS_ASSUME_NONNULL_BEGIN /*! `PFProductTableViewController` displays in-app purchase products stored on Parse. @@ -44,4 +44,4 @@ PFUI_ASSUME_NONNULL_BEGIN @end -PFUI_ASSUME_NONNULL_END +NS_ASSUME_NONNULL_END diff --git a/ParseUI/Classes/QueryCollectionViewController/PFQueryCollectionViewController.h b/ParseUI/Classes/QueryCollectionViewController/PFQueryCollectionViewController.h index 8d34273..b8b7ce9 100644 --- a/ParseUI/Classes/QueryCollectionViewController/PFQueryCollectionViewController.h +++ b/ParseUI/Classes/QueryCollectionViewController/PFQueryCollectionViewController.h @@ -23,7 +23,7 @@ #import -PFUI_ASSUME_NONNULL_BEGIN +NS_ASSUME_NONNULL_BEGIN @class BFTask; @class PFCollectionViewCell; @@ -50,7 +50,7 @@ PFUI_ASSUME_NONNULL_BEGIN /*! @abstract The class name of the this collection will use as a datasource. */ -@property (PFUI_NULLABLE_PROPERTY nonatomic, copy) IBInspectable NSString *parseClassName; +@property (nullable, nonatomic, copy) IBInspectable NSString *parseClassName; /*! @abstract Whether the collection should use the default loading view. Default - `YES`. @@ -89,7 +89,7 @@ PFUI_ASSUME_NONNULL_BEGIN @returns An initialized `PFQueryCollectionViewController` object or `nil` if the object couldn't be created. */ -- (instancetype)initWithClassName:(PFUI_NULLABLE NSString *)className; +- (instancetype)initWithClassName:(nullable NSString *)className; /*! @abstract Initializes a view controller with a class name of that will be associated with this collection. @@ -100,7 +100,7 @@ PFUI_ASSUME_NONNULL_BEGIN @returns An initialized `PFQueryCollectionViewController` object or `nil` if the object couldn't be created. */ - (instancetype)initWithCollectionViewLayout:(UICollectionViewLayout *)layout - className:(PFUI_NULLABLE NSString *)className NS_DESIGNATED_INITIALIZER; + className:(nullable NSString *)className NS_DESIGNATED_INITIALIZER; ///-------------------------------------- /// @name Responding to Events @@ -117,7 +117,7 @@ PFUI_ASSUME_NONNULL_BEGIN call [super objectsDidLoad:] in your implementation. @param error The Parse error from running the PFQuery, if there was any. */ -- (void)objectsDidLoad:(PFUI_NULLABLE NSError *)error NS_REQUIRES_SUPER; +- (void)objectsDidLoad:(nullable NSError *)error NS_REQUIRES_SUPER; ///-------------------------------------- /// @name Accessing Results @@ -138,17 +138,17 @@ PFUI_ASSUME_NONNULL_BEGIN @returns The object at the specified indexPath. */ -- (PFUI_NULLABLE PFObject *)objectAtIndexPath:(PFUI_NULLABLE NSIndexPath *)indexPath; +- (nullable PFObject *)objectAtIndexPath:(nullable NSIndexPath *)indexPath; /*! @abstract Removes an object at the specified index path, animated. */ -- (void)removeObjectAtIndexPath:(PFUI_NULLABLE NSIndexPath *)indexPath; +- (void)removeObjectAtIndexPath:(nullable NSIndexPath *)indexPath; /*! @abstract Removes all objects at the specified index paths, animated. */ -- (void)removeObjectsAtIndexPaths:(PFUI_NULLABLE NSArray *)indexes; +- (void)removeObjectsAtIndexPaths:(nullable NSArray *)indexes; ///-------------------------------------- /// @name Loading Data @@ -208,9 +208,9 @@ PFUI_ASSUME_NONNULL_BEGIN @returns The cell that represents this object. */ -- (PFUI_NULLABLE PFCollectionViewCell *)collectionView:(UICollectionView *)collectionView +- (nullable PFCollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath - object:(PFUI_NULLABLE PFObject *)object; + object:(nullable PFObject *)object; /*! @discussion Override this method to customize the view that allows the user to load the @@ -220,8 +220,8 @@ PFUI_ASSUME_NONNULL_BEGIN @returns The view that allows the user to paginate. */ -- (PFUI_NULLABLE UICollectionReusableView *)collectionViewReusableViewForNextPageAction:(UICollectionView *)collectionView; +- (nullable UICollectionReusableView *)collectionViewReusableViewForNextPageAction:(UICollectionView *)collectionView; @end -PFUI_ASSUME_NONNULL_END +NS_ASSUME_NONNULL_END diff --git a/ParseUI/Classes/QueryTableViewController/PFQueryTableViewController.h b/ParseUI/Classes/QueryTableViewController/PFQueryTableViewController.h index 4eb1d8b..8bb56a3 100644 --- a/ParseUI/Classes/QueryTableViewController/PFQueryTableViewController.h +++ b/ParseUI/Classes/QueryTableViewController/PFQueryTableViewController.h @@ -23,7 +23,7 @@ #import -PFUI_ASSUME_NONNULL_BEGIN +NS_ASSUME_NONNULL_BEGIN @class BFTask; @class PFObject; @@ -58,7 +58,7 @@ PFUI_ASSUME_NONNULL_BEGIN @returns An initialized `PFQueryTableViewController` object or `nil` if the object couldn't be created. */ - (instancetype)initWithStyle:(UITableViewStyle)style - className:(PFUI_NULLABLE NSString *)className NS_DESIGNATED_INITIALIZER; + className:(nullable NSString *)className NS_DESIGNATED_INITIALIZER; /*! @abstract Initializes with a class name of the PFObjects that will be associated with this table. @@ -67,7 +67,7 @@ PFUI_ASSUME_NONNULL_BEGIN @returns An initialized `PFQueryTableViewController` object or `nil` if the object couldn't be created. */ -- (instancetype)initWithClassName:(PFUI_NULLABLE NSString *)className; +- (instancetype)initWithClassName:(nullable NSString *)className; ///-------------------------------------- /// @name Configuring Behavior @@ -76,28 +76,28 @@ PFUI_ASSUME_NONNULL_BEGIN /*! @abstract The class name of the this table will use as a datasource. */ -@property (PFUI_NULLABLE_PROPERTY nonatomic, copy) IBInspectable NSString *parseClassName; +@property (nullable, nonatomic, copy) IBInspectable NSString *parseClassName; /*! @abstract The key to use to display for the cell text label. @discussion This won't apply if you override */ -@property (PFUI_NULLABLE_PROPERTY nonatomic, copy) IBInspectable NSString *textKey; +@property (nullable, nonatomic, copy) IBInspectable NSString *textKey; /*! @abstract The key to use to display for the cell image view. @discussion This won't apply if you override */ -@property (PFUI_NULLABLE_PROPERTY nonatomic, copy) IBInspectable NSString *imageKey; +@property (nullable, nonatomic, copy) IBInspectable NSString *imageKey; /*! @abstract The image to use as a placeholder for the cell images. @discussion This won't apply if you override */ -@property (PFUI_NULLABLE_PROPERTY nonatomic, strong) IBInspectable UIImage *placeholderImage; +@property (nullable, nonatomic, strong) IBInspectable UIImage *placeholderImage; /*! @abstract Whether the table should use the default loading view. Default - `YES`. @@ -139,7 +139,7 @@ PFUI_ASSUME_NONNULL_BEGIN call [super objectsDidLoad:] in your implementation. @param error The Parse error from running the PFQuery, if there was any. */ -- (void)objectsDidLoad:(PFUI_NULLABLE NSError *)error; +- (void)objectsDidLoad:(nullable NSError *)error; ///-------------------------------------- /// @name Accessing Results @@ -148,7 +148,7 @@ PFUI_ASSUME_NONNULL_BEGIN /*! @abstract The array of instances of that is used as a data source. */ -@property (PFUI_NULLABLE_PROPERTY nonatomic, copy, readonly) NSArray *objects; +@property (nullable, nonatomic, copy, readonly) NSArray *objects; /*! @abstract Returns an object at a particular indexPath. @@ -160,27 +160,27 @@ PFUI_ASSUME_NONNULL_BEGIN @returns The object at the specified index */ -- (PFUI_NULLABLE PFObject *)objectAtIndexPath:(PFUI_NULLABLE NSIndexPath *)indexPath; +- (nullable PFObject *)objectAtIndexPath:(nullable NSIndexPath *)indexPath; /*! @abstract Removes an object at the specified index path, animated. */ -- (void)removeObjectAtIndexPath:(PFUI_NULLABLE NSIndexPath *)indexPath; +- (void)removeObjectAtIndexPath:(nullable NSIndexPath *)indexPath; /*! @abstract Removes an object at the specified index path, with or without animation. */ -- (void)removeObjectAtIndexPath:(PFUI_NULLABLE NSIndexPath *)indexPath animated:(BOOL)animated; +- (void)removeObjectAtIndexPath:(nullable NSIndexPath *)indexPath animated:(BOOL)animated; /*! @abstract Removes all objects at the specified index paths, animated. */ -- (void)removeObjectsAtIndexPaths:(PFUI_NULLABLE NSArray *)indexes; +- (void)removeObjectsAtIndexPaths:(nullable NSArray *)indexes; /*! @abstract Removes all objects at the specified index paths, with or without animation. */ -- (void)removeObjectsAtIndexPaths:(PFUI_NULLABLE NSArray *)indexes animated:(BOOL)animated; +- (void)removeObjectsAtIndexPaths:(nullable NSArray *)indexes animated:(BOOL)animated; /*! @abstract Clears the table of all objects. @@ -238,9 +238,9 @@ PFUI_ASSUME_NONNULL_BEGIN @returns The cell that represents this object. */ -- (PFUI_NULLABLE PFTableViewCell *)tableView:(UITableView *)tableView +- (nullable PFTableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath - object:(PFUI_NULLABLE PFObject *)object; + object:(nullable PFObject *)object; /*! @discussion Override this method to customize the cell that allows the user to load the @@ -251,9 +251,9 @@ PFUI_ASSUME_NONNULL_BEGIN @returns The cell that allows the user to paginate. */ -- (PFUI_NULLABLE PFTableViewCell *)tableView:(UITableView *)tableView +- (nullable PFTableViewCell *)tableView:(UITableView *)tableView cellForNextPageAtIndexPath:(NSIndexPath *)indexPath; @end -PFUI_ASSUME_NONNULL_END +NS_ASSUME_NONNULL_END diff --git a/ParseUI/Classes/SignUpViewController/PFSignUpView.h b/ParseUI/Classes/SignUpViewController/PFSignUpView.h index d6a8795..db9d641 100644 --- a/ParseUI/Classes/SignUpViewController/PFSignUpView.h +++ b/ParseUI/Classes/SignUpViewController/PFSignUpView.h @@ -23,7 +23,7 @@ #import -PFUI_ASSUME_NONNULL_BEGIN +NS_ASSUME_NONNULL_BEGIN /*! `PFSignUpFields` bitmask specifies the sign up elements which are enabled in the view. @@ -76,7 +76,7 @@ typedef NS_OPTIONS(NSInteger, PFSignUpFields) { @discussion Used to lay out elements correctly when the presenting view controller has translucent elements. */ -@property (PFUI_NULLABLE_PROPERTY nonatomic, weak) UIViewController *presentingViewController; +@property (nullable, nonatomic, weak) UIViewController *presentingViewController; ///-------------------------------------- /// @name Customizing the Logo @@ -85,7 +85,7 @@ typedef NS_OPTIONS(NSInteger, PFSignUpFields) { /*! @abstract The logo. By default, it is the Parse logo. */ -@property (PFUI_NULLABLE_PROPERTY nonatomic, strong) UIView *logo; +@property (nullable, nonatomic, strong) UIView *logo; ///-------------------------------------- /// @name Configure Username Behaviour @@ -110,35 +110,35 @@ typedef NS_OPTIONS(NSInteger, PFSignUpFields) { /*! @abstract The username text field. */ -@property (PFUI_NULLABLE_PROPERTY nonatomic, strong, readonly) PFTextField *usernameField; +@property (nullable, nonatomic, strong, readonly) PFTextField *usernameField; /*! @abstract The password text field. */ -@property (PFUI_NULLABLE_PROPERTY nonatomic, strong, readonly) PFTextField *passwordField; +@property (nullable, nonatomic, strong, readonly) PFTextField *passwordField; /*! @abstract The email text field. It is `nil` if the element is not enabled. */ -@property (PFUI_NULLABLE_PROPERTY nonatomic, strong, readonly) PFTextField *emailField; +@property (nullable, nonatomic, strong, readonly) PFTextField *emailField; /*! @abstract The additional text field. It is `nil` if the element is not enabled. @discussion This field is intended to be customized. */ -@property (PFUI_NULLABLE_PROPERTY nonatomic, strong, readonly) PFTextField *additionalField; +@property (nullable, nonatomic, strong, readonly) PFTextField *additionalField; /*! @abstract The sign up button. It is `nil` if the element is not enabled. */ -@property (PFUI_NULLABLE_PROPERTY nonatomic, strong, readonly) UIButton *signUpButton; +@property (nullable, nonatomic, strong, readonly) UIButton *signUpButton; /*! @abstract The dismiss button. It is `nil` if the element is not enabled. */ -@property (PFUI_NULLABLE_PROPERTY nonatomic, strong, readonly) UIButton *dismissButton; +@property (nullable, nonatomic, strong, readonly) UIButton *dismissButton; @end -PFUI_ASSUME_NONNULL_END +NS_ASSUME_NONNULL_END diff --git a/ParseUI/Classes/SignUpViewController/PFSignUpViewController.h b/ParseUI/Classes/SignUpViewController/PFSignUpViewController.h index 88b2332..5e13f4c 100644 --- a/ParseUI/Classes/SignUpViewController/PFSignUpViewController.h +++ b/ParseUI/Classes/SignUpViewController/PFSignUpViewController.h @@ -27,7 +27,7 @@ @class PFUser; @protocol PFSignUpViewControllerDelegate; -PFUI_ASSUME_NONNULL_BEGIN +NS_ASSUME_NONNULL_BEGIN /*! The `PFSignUpViewController` class that presents and manages @@ -51,7 +51,7 @@ PFUI_ASSUME_NONNULL_BEGIN @see PFSignUpView */ -@property (PFUI_NULLABLE_PROPERTY nonatomic, strong, readonly) PFSignUpView *signUpView; +@property (nullable, nonatomic, strong, readonly) PFSignUpView *signUpView; ///-------------------------------------- /// @name Configuring Sign Up Behaviors @@ -62,7 +62,7 @@ PFUI_ASSUME_NONNULL_BEGIN @see PFSignUpViewControllerDelegate */ -@property (PFUI_NULLABLE_PROPERTY nonatomic, weak) id delegate; +@property (nullable, nonatomic, weak) id delegate; /*! @abstract Minimum required password length for user signups, defaults to `0`. @@ -146,7 +146,7 @@ extern NSString *const PFSignUpCancelNotification; @param error `NSError` object representing the error that occured. */ - (void)signUpViewController:(PFSignUpViewController *)signUpController - didFailToSignUpWithError:(PFUI_NULLABLE NSError *)error; + didFailToSignUpWithError:(nullable NSError *)error; /*! @abstract Sent to the delegate when the sign up screen is cancelled. @@ -157,4 +157,4 @@ extern NSString *const PFSignUpCancelNotification; @end -PFUI_ASSUME_NONNULL_END +NS_ASSUME_NONNULL_END diff --git a/ParseUI/Classes/Views/PFImageView.h b/ParseUI/Classes/Views/PFImageView.h index 368b3d6..67c5909 100644 --- a/ParseUI/Classes/Views/PFImageView.h +++ b/ParseUI/Classes/Views/PFImageView.h @@ -23,9 +23,9 @@ #import -PFUI_ASSUME_NONNULL_BEGIN +NS_ASSUME_NONNULL_BEGIN -typedef void(^PFImageViewImageResultBlock)(UIImage *PFUI_NULLABLE_S image, NSError *PFUI_NULLABLE_S error); +typedef void(^PFImageViewImageResultBlock)(UIImage *__nullable image, NSError *__nullable error); @class BFTask; @class PFFile; @@ -40,7 +40,7 @@ typedef void(^PFImageViewImageResultBlock)(UIImage *PFUI_NULLABLE_S image, NSEr @warning Note that the download does not start until is called. */ -@property (PFUI_NULLABLE_PROPERTY nonatomic, strong) PFFile *file; +@property (nullable, nonatomic, strong) PFFile *file; /*! @abstract Initiate downloading of the remote image. @@ -58,7 +58,7 @@ typedef void(^PFImageViewImageResultBlock)(UIImage *PFUI_NULLABLE_S image, NSEr @param completion the completion block. */ -- (void)loadInBackground:(PFUI_NULLABLE PFImageViewImageResultBlock)completion; +- (void)loadInBackground:(nullable PFImageViewImageResultBlock)completion; /*! @abstract Initiate downloading of the remote image. @@ -69,9 +69,9 @@ typedef void(^PFImageViewImageResultBlock)(UIImage *PFUI_NULLABLE_S image, NSEr @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:(PFUI_NULLABLE PFImageViewImageResultBlock)completion - progressBlock:(PFUI_NULLABLE void (^)(int percentDone))progressBlock; +- (void)loadInBackground:(nullable PFImageViewImageResultBlock)completion + progressBlock:(nullable void (^)(int percentDone))progressBlock; @end -PFUI_ASSUME_NONNULL_END +NS_ASSUME_NONNULL_END diff --git a/ParseUI/Classes/Views/PFTextField.h b/ParseUI/Classes/Views/PFTextField.h index 5bfb168..c50781e 100644 --- a/ParseUI/Classes/Views/PFTextField.h +++ b/ParseUI/Classes/Views/PFTextField.h @@ -23,7 +23,7 @@ #import -PFUI_ASSUME_NONNULL_BEGIN +NS_ASSUME_NONNULL_BEGIN /*! `PFTextFieldSeparatorStyle` bitmask specifies the style of the separators, @@ -60,7 +60,7 @@ typedef NS_OPTIONS(uint8_t, PFTextFieldSeparatorStyle){ @discussion Default: `227,227,227,1.0`. */ -@property (PFUI_NULLABLE_PROPERTY nonatomic, strong) UIColor *separatorColor UI_APPEARANCE_SELECTOR; +@property (nullable, nonatomic, strong) UIColor *separatorColor UI_APPEARANCE_SELECTOR; /*! This method is a convenience initializer that sets both `frame` and `separatorStyle` for an instance of `PFTextField.` @@ -74,4 +74,4 @@ typedef NS_OPTIONS(uint8_t, PFTextFieldSeparatorStyle){ @end -PFUI_ASSUME_NONNULL_END +NS_ASSUME_NONNULL_END diff --git a/ParseUI/Other/ParseUIConstants.h b/ParseUI/Other/ParseUIConstants.h index 19cfa1d..edd970a 100644 --- a/ParseUI/Other/ParseUIConstants.h +++ b/ParseUI/Other/ParseUIConstants.h @@ -41,36 +41,4 @@ # endif #endif -///-------------------------------------- -/// @name Nullability Support -///-------------------------------------- - -#if __has_feature(nullability) -# define PFUI_NULLABLE nullable -# define PFUI_NULLABLE_S __nullable -# define PFUI_NULL_UNSPECIFIED null_unspecified -# define PFUI_NULLABLE_PROPERTY nullable, -#else -# define PFUI_NULLABLE -# define PFUI_NULLABLE_S -# define PFUI_NULL_UNSPECIFIED -# define PFUI_NULLABLE_PROPERTY -#endif - -#if __has_feature(assume_nonnull) -# ifdef NS_ASSUME_NONNULL_BEGIN -# define PFUI_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN -# else -# define PFUI_ASSUME_NONNULL_BEGIN _Pragma("clang assume_nonnull begin") -# endif -# ifdef NS_ASSUME_NONNULL_END -# define PFUI_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END -# else -# define PFUI_ASSUME_NONNULL_END _Pragma("clang assume_nonnull end") -# endif -#else -# define PFUI_ASSUME_NONNULL_BEGIN -# define PFUI_ASSUME_NONNULL_END -#endif - #endif