Skip to content

Commit

Permalink
Merge pull request #619 from Simperium/issue/nullability-specifiers
Browse files Browse the repository at this point in the history
Nullability Specifiers
  • Loading branch information
jleandroperez committed Mar 8, 2021
2 parents 657970c + 3d37f5f commit 3a81343
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
4 changes: 4 additions & 0 deletions Simperium/SPAuthenticationConfiguration.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
#endif


NS_ASSUME_NONNULL_BEGIN

#pragma mark ====================================================================================
#pragma mark SPAuthenticationConfiguration
#pragma mark ====================================================================================
Expand All @@ -36,3 +38,5 @@
- (float)regularFontHeightForSize:(float)size;

@end

NS_ASSUME_NONNULL_END
16 changes: 10 additions & 6 deletions Simperium/Simperium.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
#endif


NS_ASSUME_NONNULL_BEGIN

@class Simperium;

#if TARGET_OS_IPHONE
Expand Down Expand Up @@ -79,7 +81,7 @@ typedef NS_ENUM(NSInteger, SPSimperiumErrors) {
context:(NSManagedObjectContext *)context
coordinator:(NSPersistentStoreCoordinator *)coordinator
label:(NSString *)label
bucketOverrides:(NSDictionary *)bucketOverrides;
bucketOverrides:(nullable NSDictionary *)bucketOverrides;

#if TARGET_OS_IPHONE
// Starts Simperium and displays the auth interface, if needed.
Expand Down Expand Up @@ -110,7 +112,7 @@ typedef void (^SimperiumBackgroundFetchCompletion)(UIBackgroundFetchResult resul

// Get a particular bucket (which, for Core Data, corresponds to a particular Entity name in your model).
// Once you have a bucket instance, you can set a SPBucketDelegate to react to changes.
- (SPBucket *)bucketForName:(NSString *)name;
- (nullable SPBucket *)bucketForName:(NSString *)name;

// Convenience methods for accessing the Core Data stack.
- (NSManagedObjectContext *)managedObjectContext;
Expand All @@ -132,7 +134,7 @@ typedef void (^SimperiumBackgroundFetchCompletion)(UIBackgroundFetchResult resul
// Clears all locally stored data from the device. Can be used to perform a manual sign out.
// Note: This method is now asynchronous. Please, listen to signout delegate calls, or implement a completion callback block.
typedef void (^SimperiumSignoutCompletion)(void);
- (void)signOutAndRemoveLocalData:(BOOL)remove completion:(SimperiumSignoutCompletion)completion;
- (void)signOutAndRemoveLocalData:(BOOL)remove completion:(nullable SimperiumSignoutCompletion)completion;

// Removes all of the sync'ing metadata. This helper method may be used after a faulty core data migration, to ensure
// sync'ing consistency: next time Simperium is authenticated, it will resync the entire database again.
Expand All @@ -143,7 +145,7 @@ typedef void (^SimperiumSignoutCompletion)(void);

// Alternative to setting delegates on each individual bucket (if you want a single handler for everything).
// If you need to, call this after starting Simperium.
- (void)setAllBucketDelegates:(id<SPBucketDelegate>)aDelegate;
- (void)setAllBucketDelegates:(nullable id<SPBucketDelegate>)aDelegate;

// Alternative to toggling propertyMismatchFailsafeE on each individual bucket (if you want the same behavior everywhere).
// When enabled, Simperium will capture any exceptions thrown while setting property values, and log the error.
Expand Down Expand Up @@ -184,7 +186,7 @@ typedef void (^SimperiumSignoutCompletion)(void);
@property (nonatomic, readwrite, assign) BOOL validatesObjects;

// Returns the currently authenticated Simperium user.
@property (nonatomic, readonly, strong) SPUser *user;
@property (nonatomic, readonly, strong, nullable) SPUser *user;

// The full URL used to communicate with Simperium.
@property (nonatomic, readonly, copy) NSString *appURL;
Expand All @@ -202,7 +204,7 @@ typedef void (^SimperiumSignoutCompletion)(void);
@property (nonatomic, readonly, copy) NSString *clientID;

// Remote Bucket Name Overrides!
@property (nonatomic, readonly, copy) NSDictionary *bucketOverrides;
@property (nonatomic, readonly, nullable, copy) NSDictionary *bucketOverrides;

// Returns the current SPAuthenticator instance.
@property (nonatomic, readwrite, strong) SPAuthenticator *authenticator;
Expand Down Expand Up @@ -239,3 +241,5 @@ typedef void (^SimperiumSignoutCompletion)(void);
#endif

@end

NS_ASSUME_NONNULL_END

0 comments on commit 3a81343

Please sign in to comment.