Bläddra i källkod

Update nullability annotations for GIDProfileData.

Peter Andrews 4 år sedan
förälder
incheckning
69f6490071

+ 4 - 4
GoogleSignIn/Sources/GIDProfileData.m

@@ -32,9 +32,9 @@ static NSString *const kOldImageURLStringKey = @"picture";
 
 - (instancetype)initWithEmail:(NSString *)email
                          name:(NSString *)name
-                    givenName:(NSString *)givenName
-                   familyName:(NSString *)familyName
-                     imageURL:(NSURL *)imageURL {
+                    givenName:(nullable NSString *)givenName
+                   familyName:(nullable NSString *)familyName
+                     imageURL:(nullable NSURL *)imageURL {
   self = [super init];
   if (self) {
     _email = [email copy];
@@ -50,7 +50,7 @@ static NSString *const kOldImageURLStringKey = @"picture";
   return _imageURL != nil;
 }
 
-- (NSURL *)imageURLWithDimension:(NSUInteger)dimension {
+- (nullable NSURL *)imageURLWithDimension:(NSUInteger)dimension {
   if (!_imageURL) {
     return nil;
   }

+ 3 - 3
GoogleSignIn/Sources/GIDProfileData_Private.h

@@ -24,9 +24,9 @@ NS_ASSUME_NONNULL_BEGIN
 // Initialize with profile attributes.
 - (instancetype)initWithEmail:(NSString *)email
                          name:(NSString *)name
-                    givenName:(NSString *)givenName
-                   familyName:(NSString *)familyName
-                     imageURL:(NSURL *)imageURL;
+                    givenName:(nullable NSString *)givenName
+                   familyName:(nullable NSString *)familyName
+                     imageURL:(nullable NSURL *)imageURL;
 
 @end
 

+ 3 - 3
GoogleSignIn/Sources/Public/GoogleSignIn/GIDProfileData.h

@@ -28,10 +28,10 @@ NS_ASSUME_NONNULL_BEGIN
 @property(nonatomic, readonly) NSString *name;
 
 /// The Google user's given name.
-@property(nonatomic, readonly) NSString *givenName;
+@property(nonatomic, readonly, nullable) NSString *givenName;
 
 /// The Google user's family name.
-@property(nonatomic, readonly) NSString *familyName;
+@property(nonatomic, readonly, nullable) NSString *familyName;
 
 /// Whether or not the user has profile image.
 @property(nonatomic, readonly) BOOL hasImage;
@@ -40,7 +40,7 @@ NS_ASSUME_NONNULL_BEGIN
 ///
 /// @param dimension The desired height (and width) of the profile image.
 /// @return The URL of the user's profile image.
-- (NSURL *)imageURLWithDimension:(NSUInteger)dimension;
+- (nullable NSURL *)imageURLWithDimension:(NSUInteger)dimension;
 
 @end