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

Commit 9f02988

Browse files
committed
Add nullability annotations to PFSignUpViewController, PFSignUpView.
1 parent a9b28b5 commit 9f02988

File tree

2 files changed

+23
-11
lines changed

2 files changed

+23
-11
lines changed

ParseUI/Classes/SignUpViewController/PFSignUpView.h

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121

2222
#import <UIKit/UIKit.h>
2323

24+
#import <ParseUI/ParseUIConstants.h>
25+
26+
PFUI_ASSUME_NONNULL_BEGIN
27+
2428
/*!
2529
`PFSignUpFields` bitmask specifies the sign up elements which are enabled in the view.
2630
@@ -72,7 +76,7 @@ typedef NS_OPTIONS(NSInteger, PFSignUpFields) {
7276
7377
@discussion Used to lay out elements correctly when the presenting view controller has translucent elements.
7478
*/
75-
@property (nonatomic, weak) UIViewController *presentingViewController;
79+
@property (PFUI_NULLABLE_PROPERTY nonatomic, weak) UIViewController *presentingViewController;
7680

7781
///--------------------------------------
7882
/// @name Customizing the Logo
@@ -81,7 +85,7 @@ typedef NS_OPTIONS(NSInteger, PFSignUpFields) {
8185
/*!
8286
@abstract The logo. By default, it is the Parse logo.
8387
*/
84-
@property (nonatomic, strong) UIView *logo;
88+
@property (PFUI_NULLABLE_PROPERTY nonatomic, strong) UIView *logo;
8589

8690
///--------------------------------------
8791
/// @name Configure Username Behaviour
@@ -106,33 +110,35 @@ typedef NS_OPTIONS(NSInteger, PFSignUpFields) {
106110
/*!
107111
@abstract The username text field.
108112
*/
109-
@property (nonatomic, strong, readonly) PFTextField *usernameField;
113+
@property (PFUI_NULLABLE_PROPERTY nonatomic, strong, readonly) PFTextField *usernameField;
110114

111115
/*!
112116
@abstract The password text field.
113117
*/
114-
@property (nonatomic, strong, readonly) PFTextField *passwordField;
118+
@property (PFUI_NULLABLE_PROPERTY nonatomic, strong, readonly) PFTextField *passwordField;
115119

116120
/*!
117121
@abstract The email text field. It is `nil` if the element is not enabled.
118122
*/
119-
@property (nonatomic, strong, readonly) PFTextField *emailField;
123+
@property (PFUI_NULLABLE_PROPERTY nonatomic, strong, readonly) PFTextField *emailField;
120124

121125
/*!
122126
@abstract The additional text field. It is `nil` if the element is not enabled.
123127
124128
@discussion This field is intended to be customized.
125129
*/
126-
@property (nonatomic, strong, readonly) PFTextField *additionalField;
130+
@property (PFUI_NULLABLE_PROPERTY nonatomic, strong, readonly) PFTextField *additionalField;
127131

128132
/*!
129133
@abstract The sign up button. It is `nil` if the element is not enabled.
130134
*/
131-
@property (nonatomic, strong, readonly) UIButton *signUpButton;
135+
@property (PFUI_NULLABLE_PROPERTY nonatomic, strong, readonly) UIButton *signUpButton;
132136

133137
/*!
134138
@abstract The dismiss button. It is `nil` if the element is not enabled.
135139
*/
136-
@property (nonatomic, strong, readonly) UIButton *dismissButton;
140+
@property (PFUI_NULLABLE_PROPERTY nonatomic, strong, readonly) UIButton *dismissButton;
137141

138142
@end
143+
144+
PFUI_ASSUME_NONNULL_END

ParseUI/Classes/SignUpViewController/PFSignUpViewController.h

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,14 @@
2121

2222
#import <UIKit/UIKit.h>
2323

24+
#import <ParseUI/ParseUIConstants.h>
2425
#import <ParseUI/PFSignUpView.h>
2526

2627
@class PFUser;
2728
@protocol PFSignUpViewControllerDelegate;
2829

30+
PFUI_ASSUME_NONNULL_BEGIN
31+
2932
/*!
3033
The `PFSignUpViewController` class that presents and manages
3134
a standard authentication interface for signing up a <PFUser>.
@@ -48,7 +51,7 @@
4851
4952
@see PFSignUpView
5053
*/
51-
@property (nonatomic, strong, readonly) PFSignUpView *signUpView;
54+
@property (PFUI_NULLABLE_PROPERTY nonatomic, strong, readonly) PFSignUpView *signUpView;
5255

5356
///--------------------------------------
5457
/// @name Configuring Sign Up Behaviors
@@ -59,7 +62,7 @@
5962
6063
@see PFSignUpViewControllerDelegate
6164
*/
62-
@property (nonatomic, weak) id<PFSignUpViewControllerDelegate> delegate;
65+
@property (PFUI_NULLABLE_PROPERTY nonatomic, weak) id<PFSignUpViewControllerDelegate> delegate;
6366

6467
/*!
6568
@abstract Minimum required password length for user signups, defaults to `0`.
@@ -142,7 +145,8 @@ extern NSString *const PFSignUpCancelNotification;
142145
@param signUpController The signup view controller where signup failed.
143146
@param error `NSError` object representing the error that occured.
144147
*/
145-
- (void)signUpViewController:(PFSignUpViewController *)signUpController didFailToSignUpWithError:(NSError *)error;
148+
- (void)signUpViewController:(PFSignUpViewController *)signUpController
149+
didFailToSignUpWithError:(PFUI_NULLABLE NSError *)error;
146150

147151
/*!
148152
@abstract Sent to the delegate when the sign up screen is cancelled.
@@ -152,3 +156,5 @@ extern NSString *const PFSignUpCancelNotification;
152156
- (void)signUpViewControllerDidCancelSignUp:(PFSignUpViewController *)signUpController;
153157

154158
@end
159+
160+
PFUI_ASSUME_NONNULL_END

0 commit comments

Comments
 (0)