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

Commit a9b28b5

Browse files
committed
Add nullability annotations to PFLogInViewController, PFLogInView.
1 parent 51d18b3 commit a9b28b5

File tree

2 files changed

+27
-17
lines changed

2 files changed

+27
-17
lines changed

ParseUI/Classes/LogInViewController/PFLogInView.h

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323

2424
#import <ParseUI/ParseUIConstants.h>
2525

26+
PFUI_ASSUME_NONNULL_BEGIN
27+
2628
/*!
2729
`PFLogInFields` bitmask specifies the log in elements which are enabled in the view.
2830
@@ -82,14 +84,14 @@ typedef NS_OPTIONS(NSInteger, PFLogInFields) {
8284
8385
@discussion Used to lay out elements correctly when the presenting view controller has translucent elements.
8486
*/
85-
@property (nonatomic, weak) UIViewController *presentingViewController;
87+
@property (PFUI_NULLABLE_PROPERTY nonatomic, weak) UIViewController *presentingViewController;
8688

8789
///--------------------------------------
8890
/// @name Customizing the Logo
8991
///--------------------------------------
9092

9193
/// The logo. By default, it is the Parse logo.
92-
@property (nonatomic, strong) UIView *logo;
94+
@property (PFUI_NULLABLE_PROPERTY nonatomic, strong) UIView *logo;
9395

9496
///--------------------------------------
9597
/// @name Configure Username Behaviour
@@ -114,55 +116,57 @@ typedef NS_OPTIONS(NSInteger, PFLogInFields) {
114116
/*!
115117
@abstract The username text field. It is `nil` if the element is not enabled.
116118
*/
117-
@property (nonatomic, strong, readonly) PFTextField *usernameField;
119+
@property (PFUI_NULLABLE_PROPERTY nonatomic, strong, readonly) PFTextField *usernameField;
118120

119121
/*!
120122
@abstract The password text field. It is `nil` if the element is not enabled.
121123
*/
122-
@property (nonatomic, strong, readonly) PFTextField *passwordField;
124+
@property (PFUI_NULLABLE_PROPERTY nonatomic, strong, readonly) PFTextField *passwordField;
123125

124126
/*!
125127
@abstract The password forgotten button. It is `nil` if the element is not enabled.
126128
*/
127-
@property (nonatomic, strong, readonly) UIButton *passwordForgottenButton;
129+
@property (PFUI_NULLABLE_PROPERTY nonatomic, strong, readonly) UIButton *passwordForgottenButton;
128130

129131
/*!
130132
@abstract The log in button. It is `nil` if the element is not enabled.
131133
*/
132-
@property (nonatomic, strong, readonly) UIButton *logInButton;
134+
@property (PFUI_NULLABLE_PROPERTY nonatomic, strong, readonly) UIButton *logInButton;
133135

134136
/*!
135137
@abstract The Facebook button. It is `nil` if the element is not enabled.
136138
*/
137-
@property (nonatomic, strong, readonly) UIButton *facebookButton;
139+
@property (PFUI_NULLABLE_PROPERTY nonatomic, strong, readonly) UIButton *facebookButton;
138140

139141
/*!
140142
@abstract The Twitter button. It is `nil` if the element is not enabled.
141143
*/
142-
@property (nonatomic, strong, readonly) UIButton *twitterButton;
144+
@property (PFUI_NULLABLE_PROPERTY nonatomic, strong, readonly) UIButton *twitterButton;
143145

144146
/*!
145147
@abstract The sign up button. It is `nil` if the element is not enabled.
146148
*/
147-
@property (nonatomic, strong, readonly) UIButton *signUpButton;
149+
@property (PFUI_NULLABLE_PROPERTY nonatomic, strong, readonly) UIButton *signUpButton;
148150

149151
/*!
150152
@abstract It is `nil` if the element is not enabled.
151153
*/
152-
@property (nonatomic, strong, readonly) UIButton *dismissButton;
154+
@property (PFUI_NULLABLE_PROPERTY nonatomic, strong, readonly) UIButton *dismissButton;
153155

154156
/*!
155157
@abstract The facebook/twitter login label.
156158
157159
@deprecated This property is deprecated and will always be nil.
158160
*/
159-
@property (nonatomic, strong, readonly) UILabel *externalLogInLabel __attribute__(PARSE_UI_DEPRECATED("This property is deprecated and will always be nil."));
161+
@property (PFUI_NULLABLE_PROPERTY nonatomic, strong, readonly) UILabel *externalLogInLabel __attribute__(PARSE_UI_DEPRECATED("This property is deprecated and will always be nil."));
160162

161163
/*!
162164
@abstract The sign up label.
163165
164166
@deprecated This property is deprecated and will always be nil.
165167
*/
166-
@property (nonatomic, strong, readonly) UILabel *signUpLabel __attribute__(PARSE_UI_DEPRECATED("This property is deprecated and will always be nil."));
168+
@property (PFUI_NULLABLE_PROPERTY nonatomic, strong, readonly) UILabel *signUpLabel __attribute__(PARSE_UI_DEPRECATED("This property is deprecated and will always be nil."));
167169

168170
@end
171+
172+
PFUI_ASSUME_NONNULL_END

ParseUI/Classes/LogInViewController/PFLogInViewController.h

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,11 @@
2121

2222
#import <UIKit/UIKit.h>
2323

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

27+
PFUI_ASSUME_NONNULL_BEGIN
28+
2629
@class PFSignUpViewController;
2730
@class PFUser;
2831
@protocol PFLogInViewControllerDelegate;
@@ -49,7 +52,7 @@
4952
5053
@see PFLogInView
5154
*/
52-
@property (nonatomic, strong, readonly) PFLogInView *logInView;
55+
@property (PFUI_NULLABLE_PROPERTY nonatomic, strong, readonly) PFLogInView *logInView;
5356

5457
///--------------------------------------
5558
/// @name Configuring Log In Behaviors
@@ -60,22 +63,22 @@
6063
6164
@see PFLogInViewControllerDelegate
6265
*/
63-
@property (nonatomic, weak) id<PFLogInViewControllerDelegate> delegate;
66+
@property (PFUI_NULLABLE_PROPERTY nonatomic, weak) id<PFLogInViewControllerDelegate> delegate;
6467

6568
/*!
6669
@abstract The facebook permissions that Facebook log in requests for.
6770
6871
@discussion If unspecified, the default is basic facebook permissions.
6972
*/
70-
@property (nonatomic, copy) NSArray *facebookPermissions;
73+
@property (PFUI_NULLABLE_PROPERTY nonatomic, copy) NSArray *facebookPermissions;
7174

7275
/*!
7376
@abstract The sign up controller if sign up is enabled.
7477
7578
@discussion Use this to configure the sign up view, and the transition animation to the sign up view.
7679
The default is a sign up view with a username, a password, a dismiss button and a sign up button.
7780
*/
78-
@property (nonatomic, strong) PFSignUpViewController *signUpController;
81+
@property (PFUI_NULLABLE_PROPERTY nonatomic, strong) PFSignUpViewController *signUpController;
7982

8083
/*!
8184
@abstract Whether to prompt for the email as username on the login view.
@@ -155,7 +158,8 @@ shouldBeginLogInWithUsername:(NSString *)username
155158
@param logInController The login view controller where login failed.
156159
@param error `NSError` object representing the error that occured.
157160
*/
158-
- (void)logInViewController:(PFLogInViewController *)logInController didFailToLogInWithError:(NSError *)error;
161+
- (void)logInViewController:(PFLogInViewController *)logInController
162+
didFailToLogInWithError:(PFUI_NULLABLE NSError *)error;
159163

160164
/*!
161165
@abstract Sent to the delegate when the log in screen is cancelled.
@@ -165,3 +169,5 @@ shouldBeginLogInWithUsername:(NSString *)username
165169
- (void)logInViewControllerDidCancelLogIn:(PFLogInViewController *)logInController;
166170

167171
@end
172+
173+
PFUI_ASSUME_NONNULL_END

0 commit comments

Comments
 (0)