Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nullability Specifiers #619

Merged
merged 2 commits into from
Mar 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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