diff --git a/Parse/Internal/ACL/DefaultACLController/PFDefaultACLController.h b/Parse/Internal/ACL/DefaultACLController/PFDefaultACLController.h index 72aa30177..2a86550db 100644 --- a/Parse/Internal/ACL/DefaultACLController/PFDefaultACLController.h +++ b/Parse/Internal/ACL/DefaultACLController/PFDefaultACLController.h @@ -13,7 +13,7 @@ #import "PFCoreDataProvider.h" -@class BFTask PF_GENERIC(__covariant BFGenericType); +@class BFTask<__covariant BFGenericType>; @class PFACL; NS_ASSUME_NONNULL_BEGIN diff --git a/Parse/Internal/ACL/DefaultACLController/PFDefaultACLController.m b/Parse/Internal/ACL/DefaultACLController/PFDefaultACLController.m index 36bcfbc0c..a796134ff 100644 --- a/Parse/Internal/ACL/DefaultACLController/PFDefaultACLController.m +++ b/Parse/Internal/ACL/DefaultACLController/PFDefaultACLController.m @@ -47,7 +47,7 @@ + (instancetype)controllerWithDataSource:(id)da #pragma mark - ACL ///-------------------------------------- -- (BFTask PF_GENERIC(PFACL *)*)getDefaultACLAsync { +- (BFTask *)getDefaultACLAsync { return [_taskQueue enqueue:^id(BFTask *task) { if (!_defaultACL || !_useCurrentUser) { return _defaultACL; @@ -72,7 +72,7 @@ + (instancetype)controllerWithDataSource:(id)da }]; } -- (BFTask PF_GENERIC(PFACL *)*)setDefaultACLAsync:(PFACL *)acl withCurrentUserAccess:(BOOL)accessForCurrentUser { +- (BFTask *)setDefaultACLAsync:(PFACL *)acl withCurrentUserAccess:(BOOL)accessForCurrentUser { return [_taskQueue enqueue:^id(BFTask *task) { _defaultACLWithCurrentUser = nil; _lastCurrentUser = nil; diff --git a/Parse/Internal/Analytics/Controller/PFAnalyticsController.h b/Parse/Internal/Analytics/Controller/PFAnalyticsController.h index 67a227cae..ea1975e17 100644 --- a/Parse/Internal/Analytics/Controller/PFAnalyticsController.h +++ b/Parse/Internal/Analytics/Controller/PFAnalyticsController.h @@ -14,7 +14,7 @@ #import "PFDataProvider.h" #import "PFMacros.h" -@class BFTask PF_GENERIC(__covariant BFGenericType); +@class BFTask<__covariant BFGenericType>; NS_ASSUME_NONNULL_BEGIN @@ -45,8 +45,8 @@ NS_ASSUME_NONNULL_BEGIN @return `BFTask` with result set to `@YES`. */ -- (BFTask PF_GENERIC(PFVoid)*)trackAppOpenedEventAsyncWithRemoteNotificationPayload:(nullable NSDictionary *)payload - sessionToken:(nullable NSString *)sessionToken; +- (BFTask *)trackAppOpenedEventAsyncWithRemoteNotificationPayload:(nullable NSDictionary *)payload + sessionToken:(nullable NSString *)sessionToken; /** Tracks the occurrence of a custom event with additional dimensions. @@ -57,9 +57,9 @@ NS_ASSUME_NONNULL_BEGIN @return `BFTask` with result set to `@YES`. */ -- (BFTask PF_GENERIC(PFVoid)*)trackEventAsyncWithName:(NSString *)name - dimensions:(nullable NSDictionary PF_GENERIC(NSString *, NSString *)*)dimensions - sessionToken:(nullable NSString *)sessionToken; +- (BFTask *)trackEventAsyncWithName:(NSString *)name + dimensions:(nullable NSDictionary *)dimensions + sessionToken:(nullable NSString *)sessionToken; @end diff --git a/Parse/Internal/Analytics/Controller/PFAnalyticsController.m b/Parse/Internal/Analytics/Controller/PFAnalyticsController.m index cfd248b32..26405ac07 100644 --- a/Parse/Internal/Analytics/Controller/PFAnalyticsController.m +++ b/Parse/Internal/Analytics/Controller/PFAnalyticsController.m @@ -48,8 +48,8 @@ + (instancetype)controllerWithDataSource:(id)dataSour #pragma mark - Track Event ///-------------------------------------- -- (BFTask PF_GENERIC(PFVoid)*)trackAppOpenedEventAsyncWithRemoteNotificationPayload:(nullable NSDictionary *)payload - sessionToken:(nullable NSString *)sessionToken { +- (BFTask *)trackAppOpenedEventAsyncWithRemoteNotificationPayload:(nullable NSDictionary *)payload + sessionToken:(nullable NSString *)sessionToken { @weakify(self); return [[BFTask taskFromExecutor:[BFExecutor defaultPriorityBackgroundExecutor] withBlock:^id{ @strongify(self); @@ -65,9 +65,9 @@ + (instancetype)controllerWithDataSource:(id)dataSour }] continueWithSuccessResult:nil]; } -- (BFTask PF_GENERIC(PFVoid)*)trackEventAsyncWithName:(NSString *)name - dimensions:(nullable NSDictionary PF_GENERIC(NSString *, NSString *)*)dimensions - sessionToken:(nullable NSString *)sessionToken { +- (BFTask *)trackEventAsyncWithName:(NSString *)name + dimensions:(nullable NSDictionary *)dimensions + sessionToken:(nullable NSString *)sessionToken { PFParameterAssert([[name stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] length], @"A name for the custom event must be provided."); diff --git a/Parse/Internal/CloudCode/PFCloudCodeController.h b/Parse/Internal/CloudCode/PFCloudCodeController.h index ed8e8ed9d..5e1164faf 100644 --- a/Parse/Internal/CloudCode/PFCloudCodeController.h +++ b/Parse/Internal/CloudCode/PFCloudCodeController.h @@ -12,7 +12,7 @@ #import #import "PFDataProvider.h" -@class BFTask PF_GENERIC(__covariant BFGenericType); +@class BFTask<__covariant BFGenericType>; @interface PFCloudCodeController : NSObject diff --git a/Parse/Internal/Commands/CommandRunner/PFCommandRunning.h b/Parse/Internal/Commands/CommandRunner/PFCommandRunning.h index 1ec6fa0a4..130c7ae08 100644 --- a/Parse/Internal/Commands/CommandRunner/PFCommandRunning.h +++ b/Parse/Internal/Commands/CommandRunner/PFCommandRunning.h @@ -14,7 +14,7 @@ #import "PFDataProvider.h" @class BFCancellationToken; -@class BFTask PF_GENERIC(__covariant BFGenericType); +@class BFTask<__covariant BFGenericType>; @class PFCommandResult; @class PFRESTCommand; @protocol PFNetworkCommand; diff --git a/Parse/Internal/Commands/CommandRunner/URLRequestConstructor/PFCommandURLRequestConstructor.h b/Parse/Internal/Commands/CommandRunner/URLRequestConstructor/PFCommandURLRequestConstructor.h index ea0d9aaa0..d0019fa8a 100644 --- a/Parse/Internal/Commands/CommandRunner/URLRequestConstructor/PFCommandURLRequestConstructor.h +++ b/Parse/Internal/Commands/CommandRunner/URLRequestConstructor/PFCommandURLRequestConstructor.h @@ -13,7 +13,7 @@ #import "PFDataProvider.h" -@class BFTask PF_GENERIC(BFGenericType); +@class BFTask<__covariant BFGenericType>; @class PFRESTCommand; @interface PFCommandURLRequestConstructor : NSObject @@ -32,15 +32,15 @@ /// @name Data ///-------------------------------------- -- (BFTask PF_GENERIC(NSURLRequest *)*)getDataURLRequestAsyncForCommand:(PFRESTCommand *)command; +- (BFTask *)getDataURLRequestAsyncForCommand:(PFRESTCommand *)command; ///-------------------------------------- /// @name File Upload ///-------------------------------------- -- (BFTask PF_GENERIC(NSURLRequest *)*)getFileUploadURLRequestAsyncForCommand:(PFRESTCommand *)command - withContentType:(NSString *)contentType - contentSourceFilePath:(NSString *)contentFilePath; +- (BFTask *)getFileUploadURLRequestAsyncForCommand:(PFRESTCommand *)command + withContentType:(NSString *)contentType + contentSourceFilePath:(NSString *)contentFilePath; ///-------------------------------------- /// @name Headers diff --git a/Parse/Internal/Commands/CommandRunner/URLRequestConstructor/PFCommandURLRequestConstructor.m b/Parse/Internal/Commands/CommandRunner/URLRequestConstructor/PFCommandURLRequestConstructor.m index be874ea89..5bf332360 100644 --- a/Parse/Internal/Commands/CommandRunner/URLRequestConstructor/PFCommandURLRequestConstructor.m +++ b/Parse/Internal/Commands/CommandRunner/URLRequestConstructor/PFCommandURLRequestConstructor.m @@ -49,8 +49,8 @@ + (instancetype)constructorWithDataSource:(id *)getDataURLRequestAsyncForCommand:(PFRESTCommand *)command { + return (BFTask *)[[self _getURLRequestHeadersAsyncForCommand:command] continueWithSuccessBlock:^id(BFTask *task) { NSURL *url = [PFURLConstructor URLFromAbsoluteString:self.serverURL.absoluteString path:command.httpPath query:nil]; @@ -89,10 +89,10 @@ + (instancetype)constructorWithDataSource:(id *)getFileUploadURLRequestAsyncForCommand:(PFRESTCommand *)command + withContentType:(NSString *)contentType + contentSourceFilePath:(NSString *)contentFilePath { + return [[self getDataURLRequestAsyncForCommand:command] continueWithSuccessBlock:^id(BFTask *task) { NSMutableURLRequest *request = [task.result mutableCopy]; if (contentType) { @@ -145,14 +145,14 @@ + (NSDictionary *)defaultURLRequestHeadersForApplicationId:(NSString *)applicati return [mutableHeaders copy]; } -- (BFTask PF_GENERIC(NSDictionary *)*)_getURLRequestHeadersAsyncForCommand:(PFRESTCommand *)command { +- (BFTask *)_getURLRequestHeadersAsyncForCommand:(PFRESTCommand *)command { return [BFTask taskFromExecutor:[BFExecutor defaultExecutor] withBlock:^id { NSMutableDictionary *headers = [NSMutableDictionary dictionary]; [headers addEntriesFromDictionary:command.additionalRequestHeaders]; if (command.sessionToken) { headers[PFCommandHeaderNameSessionToken] = command.sessionToken; } - return [[self.dataSource.installationIdentifierStore getInstallationIdentifierAsync] continueWithSuccessBlock:^id(BFTask PF_GENERIC(NSString *)*task) { + return [[self.dataSource.installationIdentifierStore getInstallationIdentifierAsync] continueWithSuccessBlock:^id(BFTask *task) { headers[PFCommandHeaderNameInstallationId] = task.result; return [headers copy]; }]; diff --git a/Parse/Internal/Commands/CommandRunner/URLSession/PFURLSessionCommandRunner.m b/Parse/Internal/Commands/CommandRunner/URLSession/PFURLSessionCommandRunner.m index 68d982b7e..98b3a552d 100644 --- a/Parse/Internal/Commands/CommandRunner/URLSession/PFURLSessionCommandRunner.m +++ b/Parse/Internal/Commands/CommandRunner/URLSession/PFURLSessionCommandRunner.m @@ -61,7 +61,6 @@ - (instancetype)initWithDataSource:(id)da applicationId:applicationId clientKey:clientKey serverURL:serverURL]; - } - (instancetype)initWithDataSource:(id)dataSource @@ -145,16 +144,16 @@ - (void)dealloc { #pragma mark - Data Commands ///-------------------------------------- -- (BFTask PF_GENERIC(PFCommandResult *)*)runCommandAsync:(PFRESTCommand *)command withOptions:(PFCommandRunningOptions)options { +- (BFTask *)runCommandAsync:(PFRESTCommand *)command withOptions:(PFCommandRunningOptions)options { return [self runCommandAsync:command withOptions:options cancellationToken:nil]; } -- (BFTask PF_GENERIC(PFCommandResult *)*)runCommandAsync:(PFRESTCommand *)command - withOptions:(PFCommandRunningOptions)options - cancellationToken:(BFCancellationToken *)cancellationToken { +- (BFTask *)runCommandAsync:(PFRESTCommand *)command + withOptions:(PFCommandRunningOptions)options + cancellationToken:(BFCancellationToken *)cancellationToken { return [self _performCommandRunningBlock:^id { [command resolveLocalIds]; - return [[self.requestConstructor getDataURLRequestAsyncForCommand:command] continueWithSuccessBlock:^id(BFTask PF_GENERIC(NSURLRequest *)*task) { + return [[self.requestConstructor getDataURLRequestAsyncForCommand:command] continueWithSuccessBlock:^id(BFTask *task) { return [_session performDataURLRequestAsync:task.result forCommand:command cancellationToken:cancellationToken]; }]; } withOptions:options cancellationToken:cancellationToken]; @@ -164,20 +163,20 @@ - (void)dealloc { #pragma mark - File Commands ///-------------------------------------- -- (BFTask PF_GENERIC(PFCommandResult *)*)runFileUploadCommandAsync:(PFRESTCommand *)command - withContentType:(NSString *)contentType - contentSourceFilePath:(NSString *)sourceFilePath - options:(PFCommandRunningOptions)options - cancellationToken:(nullable BFCancellationToken *)cancellationToken - progressBlock:(nullable PFProgressBlock)progressBlock { +- (BFTask *)runFileUploadCommandAsync:(PFRESTCommand *)command + withContentType:(NSString *)contentType + contentSourceFilePath:(NSString *)sourceFilePath + options:(PFCommandRunningOptions)options + cancellationToken:(nullable BFCancellationToken *)cancellationToken + progressBlock:(nullable PFProgressBlock)progressBlock { @weakify(self); return [self _performCommandRunningBlock:^id { @strongify(self); [command resolveLocalIds]; return [[self.requestConstructor getFileUploadURLRequestAsyncForCommand:command - withContentType:contentType - contentSourceFilePath:sourceFilePath] continueWithSuccessBlock:^id(BFTask PF_GENERIC(NSURLRequest *)*task) { + withContentType:contentType + contentSourceFilePath:sourceFilePath] continueWithSuccessBlock:^id(BFTask *task) { return [_session performFileUploadURLRequestAsync:task.result forCommand:command withContentSourceFilePath:sourceFilePath @@ -187,10 +186,10 @@ - (void)dealloc { } withOptions:options cancellationToken:cancellationToken]; } -- (BFTask PF_GENERIC(PFCommandResult *)*)runFileDownloadCommandAsyncWithFileURL:(NSURL *)url - targetFilePath:(NSString *)filePath - cancellationToken:(nullable BFCancellationToken *)cancellationToken - progressBlock:(nullable PFProgressBlock)progressBlock { +- (BFTask *)runFileDownloadCommandAsyncWithFileURL:(NSURL *)url + targetFilePath:(NSString *)filePath + cancellationToken:(nullable BFCancellationToken *)cancellationToken + progressBlock:(nullable PFProgressBlock)progressBlock { return [self _performCommandRunningBlock:^id { NSURLRequest *request = [NSURLRequest requestWithURL:url]; return [_session performFileDownloadURLRequestAsync:request diff --git a/Parse/Internal/Commands/CommandRunner/URLSession/Session/PFURLSession.h b/Parse/Internal/Commands/CommandRunner/URLSession/Session/PFURLSession.h index ff53d2248..e6337e8f1 100644 --- a/Parse/Internal/Commands/CommandRunner/URLSession/Session/PFURLSession.h +++ b/Parse/Internal/Commands/CommandRunner/URLSession/Session/PFURLSession.h @@ -13,7 +13,7 @@ @class BFCancellationToken; -@class BFTask PF_GENERIC(__covariant BFGenericType); +@class BFTask<__covariant BFGenericType>; @class PFRESTCommand; NS_ASSUME_NONNULL_BEGIN diff --git a/Parse/Internal/Commands/CommandRunner/URLSession/Session/TaskDelegate/PFURLSessionDataTaskDelegate.h b/Parse/Internal/Commands/CommandRunner/URLSession/Session/TaskDelegate/PFURLSessionDataTaskDelegate.h index a1f8ca9c5..51a09a013 100644 --- a/Parse/Internal/Commands/CommandRunner/URLSession/Session/TaskDelegate/PFURLSessionDataTaskDelegate.h +++ b/Parse/Internal/Commands/CommandRunner/URLSession/Session/TaskDelegate/PFURLSessionDataTaskDelegate.h @@ -13,7 +13,7 @@ @class BFCancellationToken; -@class BFTask PF_GENERIC(__covariant BFGenericType); +@class BFTask <__covariant BFGenericType>; NS_ASSUME_NONNULL_BEGIN diff --git a/Parse/Internal/Commands/PFRESTObjectBatchCommand.h b/Parse/Internal/Commands/PFRESTObjectBatchCommand.h index d83d05cdd..258cf22c2 100644 --- a/Parse/Internal/Commands/PFRESTObjectBatchCommand.h +++ b/Parse/Internal/Commands/PFRESTObjectBatchCommand.h @@ -17,7 +17,7 @@ NS_ASSUME_NONNULL_BEGIN @interface PFRESTObjectBatchCommand : PFRESTCommand -+ (instancetype)batchCommandWithCommands:(NSArray PF_GENERIC(PFRESTCommand *)*)commands ++ (instancetype)batchCommandWithCommands:(NSArray *)commands sessionToken:(nullable NSString *)sessionToken serverURL:(NSURL *)serverURL; diff --git a/Parse/Internal/Commands/PFRESTObjectBatchCommand.m b/Parse/Internal/Commands/PFRESTObjectBatchCommand.m index 1879c8b9b..48d1a2da8 100644 --- a/Parse/Internal/Commands/PFRESTObjectBatchCommand.m +++ b/Parse/Internal/Commands/PFRESTObjectBatchCommand.m @@ -17,7 +17,7 @@ @implementation PFRESTObjectBatchCommand -+ (nonnull instancetype)batchCommandWithCommands:(nonnull NSArray PF_GENERIC(PFRESTCommand *)*)commands ++ (nonnull instancetype)batchCommandWithCommands:(nonnull NSArray *)commands sessionToken:(nullable NSString *)sessionToken serverURL:(nonnull NSURL *)serverURL { PFParameterAssert(commands.count <= PFRESTObjectBatchCommandSubcommandsLimit, diff --git a/Parse/Internal/Config/Controller/PFConfigController.h b/Parse/Internal/Config/Controller/PFConfigController.h index 039b34748..6cc49c2b9 100644 --- a/Parse/Internal/Config/Controller/PFConfigController.h +++ b/Parse/Internal/Config/Controller/PFConfigController.h @@ -13,7 +13,7 @@ #import "PFDataProvider.h" -@class BFTask PF_GENERIC(__covariant BFGenericType); +@class BFTask<__covariant BFGenericType>; @class PFConfig; @class PFCurrentConfigController; diff --git a/Parse/Internal/Config/Controller/PFCurrentConfigController.h b/Parse/Internal/Config/Controller/PFCurrentConfigController.h index 0db90b720..c50b00572 100644 --- a/Parse/Internal/Config/Controller/PFCurrentConfigController.h +++ b/Parse/Internal/Config/Controller/PFCurrentConfigController.h @@ -13,7 +13,7 @@ #import "PFDataProvider.h" -@class BFTask PF_GENERIC(__covariant BFGenericType); +@class BFTask<__covariant BFGenericType>; @class PFConfig; @interface PFCurrentConfigController : NSObject diff --git a/Parse/Internal/Config/Controller/PFCurrentConfigController.m b/Parse/Internal/Config/Controller/PFCurrentConfigController.m index ee00cf92e..f8e7e34f0 100644 --- a/Parse/Internal/Config/Controller/PFCurrentConfigController.m +++ b/Parse/Internal/Config/Controller/PFCurrentConfigController.m @@ -60,7 +60,7 @@ + (instancetype)controllerWithDataSource:(id)da - (BFTask *)getCurrentConfigAsync { return [_dataTaskQueue enqueue:^id(BFTask *_) { if (!_currentConfig) { - return [[self _loadConfigAsync] continueWithSuccessBlock:^id(BFTask PF_GENERIC(PFConfig *)*task) { + return [[self _loadConfigAsync] continueWithSuccessBlock:^id(BFTask *task) { _currentConfig = task.result; return _currentConfig; }]; @@ -106,7 +106,7 @@ - (BFTask *)clearMemoryCachedCurrentConfigAsync { #pragma mark - Data ///-------------------------------------- -- (BFTask PF_GENERIC(PFConfig *)*)_loadConfigAsync { +- (BFTask *)_loadConfigAsync { return [[[self _getPersistenceGroupAsync] continueWithSuccessBlock:^id(BFTask> *task) { return [task.result getDataAsyncForKey:PFConfigCurrentConfigFileName_]; }] continueWithSuccessBlock:^id(BFTask *task) { @@ -125,7 +125,7 @@ - (BFTask *)clearMemoryCachedCurrentConfigAsync { #pragma mark - Convenience ///-------------------------------------- -- (BFTask PF_GENERIC(id)*)_getPersistenceGroupAsync { +- (BFTask> *)_getPersistenceGroupAsync { return [self.dataSource.persistenceController getPersistenceGroupAsync]; } diff --git a/Parse/Internal/File/Controller/PFFileController.h b/Parse/Internal/File/Controller/PFFileController.h index d404d0ca4..429384f5a 100644 --- a/Parse/Internal/File/Controller/PFFileController.h +++ b/Parse/Internal/File/Controller/PFFileController.h @@ -15,7 +15,7 @@ #import "PFMacros.h" @class BFCancellationToken; -@class BFTask PF_GENERIC(__covariant BFGenericType); +@class BFTask<__covariant BFGenericType>; @class PFFileState; @class PFFileStagingController; @@ -36,7 +36,6 @@ + (instancetype)controllerWithDataSource:(id)dataSource; - ///-------------------------------------- /// @name Download ///-------------------------------------- diff --git a/Parse/Internal/File/Controller/PFFileStagingController.h b/Parse/Internal/File/Controller/PFFileStagingController.h index a0f2c7fff..f3c8b32f2 100644 --- a/Parse/Internal/File/Controller/PFFileStagingController.h +++ b/Parse/Internal/File/Controller/PFFileStagingController.h @@ -11,7 +11,7 @@ #import -@class BFTask PF_GENERIC(__covariant BFGenericType); +@class BFTask<__covariant BFGenericType>; NS_ASSUME_NONNULL_BEGIN diff --git a/Parse/Internal/Installation/CurrentInstallationController/PFCurrentInstallationController.h b/Parse/Internal/Installation/CurrentInstallationController/PFCurrentInstallationController.h index ba4dab7fb..8f516ad81 100644 --- a/Parse/Internal/Installation/CurrentInstallationController/PFCurrentInstallationController.h +++ b/Parse/Internal/Installation/CurrentInstallationController/PFCurrentInstallationController.h @@ -22,7 +22,7 @@ PF_WATCH_UNAVAILABLE_WARNING extern NSString *const PFCurrentInstallationFileName; extern NSString *const PFCurrentInstallationPinName; -@class BFTask PF_GENERIC(__covariant BFGenericType); +@class BFTask<__covariant BFGenericType>; @class PFInstallation; PF_TV_UNAVAILABLE PF_WATCH_UNAVAILABLE @interface PFCurrentInstallationController : NSObject diff --git a/Parse/Internal/Installation/InstallationIdentifierStore/PFInstallationIdentifierStore.h b/Parse/Internal/Installation/InstallationIdentifierStore/PFInstallationIdentifierStore.h index 898139296..847f2f69b 100644 --- a/Parse/Internal/Installation/InstallationIdentifierStore/PFInstallationIdentifierStore.h +++ b/Parse/Internal/Installation/InstallationIdentifierStore/PFInstallationIdentifierStore.h @@ -13,7 +13,7 @@ #import -@class BFTask PF_GENERIC(BFGenericType); +@class BFTask<__covariant BFGenericType>; @interface PFInstallationIdentifierStore : NSObject @@ -33,7 +33,7 @@ /** Returns a cached installationId or creates a new one, saves it to disk and returns it. */ -- (BFTask PF_GENERIC(NSString *)*)getInstallationIdentifierAsync; +- (BFTask *)getInstallationIdentifierAsync; ///-------------------------------------- /// @name Clear diff --git a/Parse/Internal/Installation/InstallationIdentifierStore/PFInstallationIdentifierStore.m b/Parse/Internal/Installation/InstallationIdentifierStore/PFInstallationIdentifierStore.m index ffd015bdb..7d4310dfd 100644 --- a/Parse/Internal/Installation/InstallationIdentifierStore/PFInstallationIdentifierStore.m +++ b/Parse/Internal/Installation/InstallationIdentifierStore/PFInstallationIdentifierStore.m @@ -55,7 +55,7 @@ - (instancetype)initWithDataSource:(id)dataSour #pragma mark - Accessors ///-------------------------------------- -- (BFTask PF_GENERIC(NSString *)*)getInstallationIdentifierAsync { +- (BFTask *)getInstallationIdentifierAsync { return [_taskQueue enqueue:^id(BFTask *_) { if (!self.installationIdentifier) { return [self _loadInstallationIdentifierAsync]; @@ -67,7 +67,7 @@ - (instancetype)initWithDataSource:(id)dataSour - (BFTask *)clearInstallationIdentifierAsync { return [_taskQueue enqueue:^id(BFTask *_) { self.installationIdentifier = nil; - return [[self _getPersistenceGroupAsync] continueWithSuccessBlock:^id(BFTask PF_GENERIC(id)*task) { + return [[self _getPersistenceGroupAsync] continueWithSuccessBlock:^id(BFTask> *task) { id group = task.result; return [[[group beginLockedContentAccessAsyncToDataForKey:PFInstallationIdentifierFileName] continueWithSuccessBlock:^id(BFTask *_) { return [group removeDataAsyncForKey:PFInstallationIdentifierFileName]; @@ -89,8 +89,8 @@ - (BFTask *)_clearCachedInstallationIdentifierAsync { #pragma mark - Disk Operations ///-------------------------------------- -- (BFTask PF_GENERIC(NSString *)*)_loadInstallationIdentifierAsync { - return (BFTask PF_GENERIC(NSString *)*)[[self _getPersistenceGroupAsync] continueWithSuccessBlock:^id(BFTask PF_GENERIC(id)*task) { +- (BFTask *)_loadInstallationIdentifierAsync { + return (BFTask *)[[self _getPersistenceGroupAsync] continueWithSuccessBlock:^id(BFTask> *task) { id group = task.result; return [[[[group beginLockedContentAccessAsyncToDataForKey:PFInstallationIdentifierFileName] continueWithSuccessBlock:^id(BFTask *_) { return [group getDataAsyncForKey:PFInstallationIdentifierFileName]; @@ -106,8 +106,8 @@ - (BFTask *)_clearCachedInstallationIdentifierAsync { } installationId = [NSUUID UUID].UUIDString.lowercaseString; return [[group setDataAsync:[installationId dataUsingEncoding:NSUTF8StringEncoding] - forKey:PFInstallationIdentifierFileName] continueWithSuccessResult:installationId]; - }] continueWithBlock:^id(BFTask PF_GENERIC(NSString *)*task) { + forKey:PFInstallationIdentifierFileName] continueWithSuccessResult:installationId]; + }] continueWithBlock:^id(BFTask *task) { [group endLockedContentAccessAsyncToDataForKey:PFInstallationIdentifierFileName]; self.installationIdentifier = task.result; return self.installationIdentifier; @@ -115,7 +115,7 @@ - (BFTask *)_clearCachedInstallationIdentifierAsync { }]; } -- (BFTask PF_GENERIC(id)*)_getPersistenceGroupAsync { +- (BFTask> *)_getPersistenceGroupAsync { return [self.dataSource.persistenceController getPersistenceGroupAsync]; } diff --git a/Parse/Internal/LocalDataStore/OfflineQueryLogic/PFOfflineQueryLogic.h b/Parse/Internal/LocalDataStore/OfflineQueryLogic/PFOfflineQueryLogic.h index ada4fdf63..98368ab71 100644 --- a/Parse/Internal/LocalDataStore/OfflineQueryLogic/PFOfflineQueryLogic.h +++ b/Parse/Internal/LocalDataStore/OfflineQueryLogic/PFOfflineQueryLogic.h @@ -13,14 +13,14 @@ #import "PFMacros.h" -@class BFTask PF_GENERIC(__covariant BFGenericType); +@class BFTask<__covariant BFGenericType>; @class PFObject; @class PFOfflineStore; @class PFQueryState; @class PFSQLiteDatabase; @class PFUser; -typedef BFTask PF_GENERIC(NSNumber *)* (^PFConstraintMatcherBlock)(PFObject *object, PFSQLiteDatabase *database); +typedef BFTask * (^PFConstraintMatcherBlock)(PFObject *object, PFSQLiteDatabase *database); typedef NS_OPTIONS(uint8_t, PFOfflineQueryOption) { PFOfflineQueryOptionOrder = 1 << 0, diff --git a/Parse/Internal/LocalDataStore/OfflineStore/PFOfflineStore.h b/Parse/Internal/LocalDataStore/OfflineStore/PFOfflineStore.h index 776aa6796..8252fbb30 100644 --- a/Parse/Internal/LocalDataStore/OfflineStore/PFOfflineStore.h +++ b/Parse/Internal/LocalDataStore/OfflineStore/PFOfflineStore.h @@ -13,7 +13,7 @@ #import "PFMacros.h" -@class BFTask PF_GENERIC(__covariant BFGenericType); +@class BFTask<__covariant BFGenericType>; @class PFFileManager; @class PFObject; @class PFPin; @@ -21,8 +21,7 @@ @class PFSQLiteDatabase; @class PFUser; -typedef NS_OPTIONS(uint8_t, PFOfflineStoreOptions) -{ +typedef NS_OPTIONS(uint8_t, PFOfflineStoreOptions) { PFOfflineStoreOptionAlwaysFetchFromSQLite = 1 << 0, }; @@ -44,7 +43,7 @@ typedef NS_OPTIONS(uint8_t, PFOfflineStoreOptions) /// @name Fetch ///-------------------------------------- -- (BFTask PF_GENERIC(PFObject *)*)fetchObjectLocallyAsync:(PFObject *)object; +- (BFTask *)fetchObjectLocallyAsync:(PFObject *)object; /** Gets the data for the given object from the offline database. Returns a task that will be @@ -54,15 +53,15 @@ typedef NS_OPTIONS(uint8_t, PFOfflineStoreOptions) @param object The object to fetch. @param database A database connection to use. */ -- (BFTask PF_GENERIC(PFObject *)*)fetchObjectLocallyAsync:(PFObject *)object database:(PFSQLiteDatabase *)database; +- (BFTask *)fetchObjectLocallyAsync:(PFObject *)object database:(PFSQLiteDatabase *)database; ///-------------------------------------- /// @name Save ///-------------------------------------- //TODO: (nlutsenko) Remove `includChildren` method, replace with PFLocalStore that wraps OfflineStore + Pin. -- (BFTask PF_GENERIC(PFVoid)*)saveObjectLocallyAsync:(PFObject *)object includeChildren:(BOOL)includeChildren; -- (BFTask PF_GENERIC(PFVoid)*)saveObjectLocallyAsync:(PFObject *)object withChildren:(NSArray PF_GENERIC(PFObject *)*)children; +- (BFTask *)saveObjectLocallyAsync:(PFObject *)object includeChildren:(BOOL)includeChildren; +- (BFTask *)saveObjectLocallyAsync:(PFObject *)object withChildren:(NSArray *)children; /** Stores an object (and optionally, every object it points to recursively) in the local database. @@ -77,9 +76,9 @@ typedef NS_OPTIONS(uint8_t, PFOfflineStoreOptions) @param children If non-empty - these children will be saved to LDS as well. @param database A database connection to use. */ -- (BFTask PF_GENERIC(PFVoid)*)saveObjectLocallyAsync:(PFObject *)object - withChildren:(NSArray PF_GENERIC(PFObject *)*)children - database:(PFSQLiteDatabase *)database; +- (BFTask *)saveObjectLocallyAsync:(PFObject *)object + withChildren:(NSArray *)children + database:(PFSQLiteDatabase *)database; ///-------------------------------------- /// @name Find @@ -90,14 +89,14 @@ typedef NS_OPTIONS(uint8_t, PFOfflineStoreOptions) @return The objects that match the query's constraint. */ -- (BFTask PF_GENERIC(NSArray *)*)findAsyncForQueryState:(PFQueryState *)queryState user:(PFUser *)user pin:(PFPin *)pin; +- (BFTask *> *)findAsyncForQueryState:(PFQueryState *)queryState user:(PFUser *)user pin:(PFPin *)pin; /** Runs a PFQueryState against the store's contents. @return The count of objects that match the query's constraint. */ -- (BFTask PF_GENERIC(NSNumber *)*)countAsyncForQueryState:(PFQueryState *)queryState user:(PFUser *)user pin:(PFPin *)pin; +- (BFTask *)countAsyncForQueryState:(PFQueryState *)queryState user:(PFUser *)user pin:(PFPin *)pin; /** Runs a PFQueryState against the store's contents. @@ -140,7 +139,7 @@ typedef NS_OPTIONS(uint8_t, PFOfflineStoreOptions) data is in memory. This will only be used when data comes back from the server after a fetch or a save. */ -- (BFTask PF_GENERIC(PFVoid)*)updateDataForObjectAsync:(PFObject *)object; +- (BFTask *)updateDataForObjectAsync:(PFObject *)object; ///-------------------------------------- /// @name Delete @@ -149,13 +148,13 @@ typedef NS_OPTIONS(uint8_t, PFOfflineStoreOptions) /** Deletes the given object from Offline Store's pins */ -- (BFTask PF_GENERIC(PFVoid)*)deleteDataForObjectAsync:(PFObject *)object; +- (BFTask *)deleteDataForObjectAsync:(PFObject *)object; ///-------------------------------------- /// @name Unpin ///-------------------------------------- -- (BFTask PF_GENERIC(PFVoid)*)unpinObjectAsync:(PFObject *)object; +- (BFTask *)unpinObjectAsync:(PFObject *)object; ///-------------------------------------- /// @name Internal Helper Methods @@ -165,8 +164,8 @@ typedef NS_OPTIONS(uint8_t, PFOfflineStoreOptions) Gets the UUID for the given object, if it has one. Otherwise, creates a new UUID for the object and adds a new row to the database for the object with no data. */ -- (BFTask PF_GENERIC(NSString *)*)getOrCreateUUIDAsyncForObject:(PFObject *)object - database:(PFSQLiteDatabase *)database; +- (BFTask *)getOrCreateUUIDAsyncForObject:(PFObject *)object + database:(PFSQLiteDatabase *)database; /** This should only be called from `PFObject.objectWithoutDataWithClassName`. diff --git a/Parse/Internal/LocalDataStore/OfflineStore/PFOfflineStore.m b/Parse/Internal/LocalDataStore/OfflineStore/PFOfflineStore.m index a557b7f7f..603c92eb9 100644 --- a/Parse/Internal/LocalDataStore/OfflineStore/PFOfflineStore.m +++ b/Parse/Internal/LocalDataStore/OfflineStore/PFOfflineStore.m @@ -56,28 +56,28 @@ @interface PFOfflineStore () always return the same instance for a given object. Objects in this map may or may not be in the database. */ -@property (nonatomic, strong, readonly) NSMapTable PF_GENERIC(NSString *, PFObject *)*classNameAndObjectIdToObjectMap; +@property (nonatomic, strong, readonly) NSMapTable *classNameAndObjectIdToObjectMap; /** In-memory set of ParseObjects that have been fetched from local database already. If the object is in the map, a fetch of it has been started. If the value is a finished task, then the fetch was completed. */ -@property (nonatomic, strong, readonly) NSMapTable PF_GENERIC(PFObject *, BFTask *)*fetchedObjects; +@property (nonatomic, strong, readonly) NSMapTable *> *fetchedObjects; /** In-memory map of ParseObject to UUID. This is used so that we can always return the same instance for a given object. Objects in this map may or may not be in the database. */ -@property (nonatomic, strong, readonly) NSMapTable PF_GENERIC(PFObject *, BFTask *)*objectToUUIDMap; +@property (nonatomic, strong, readonly) NSMapTable *> *objectToUUIDMap; /** In-memory map of UUID to ParseObject. This is used so we can always return the same instance for a given object. The only objects in this map are ones that are in database. */ -@property (nonatomic, strong, readonly) NSMapTable PF_GENERIC(NSString *, PFObject *)*UUIDToObjectMap; +@property (nonatomic, strong, readonly) NSMapTable *UUIDToObjectMap; @property (nonatomic, strong, readonly) PFOfflineQueryLogic *offlineQueryLogic; @@ -121,8 +121,8 @@ - (instancetype)initWithFileManager:(PFFileManager *)fileManager options:(PFOffl #pragma mark - Fetch ///-------------------------------------- -- (BFTask PF_GENERIC(PFObject *)*)fetchObjectLocallyAsync:(PFObject *)object { - __block BFTask PF_GENERIC(PFObject *)*fetchTask = nil; +- (BFTask *)fetchObjectLocallyAsync:(PFObject *)object { + __block BFTask *fetchTask = nil; return [[self _performDatabaseOperationAsyncWithBlock:^BFTask *(PFSQLiteDatabase *database) { // We need this to return the result of `fetchObjectLocallyAsync` instead of returning the // result of `[database closeAsync]` @@ -133,7 +133,7 @@ - (instancetype)initWithFileManager:(PFFileManager *)fileManager options:(PFOffl }]; } -- (BFTask PF_GENERIC(PFObject *)*)fetchObjectLocallyAsync:(PFObject *)object database:(PFSQLiteDatabase *)database { +- (BFTask *)fetchObjectLocallyAsync:(PFObject *)object database:(PFSQLiteDatabase *)database { BFTaskCompletionSource *tcs = [BFTaskCompletionSource taskCompletionSource]; BFTask *uuidTask = nil; @@ -291,24 +291,24 @@ - (instancetype)initWithFileManager:(PFFileManager *)fileManager options:(PFOffl #pragma mark - Save ///-------------------------------------- -- (BFTask PF_GENERIC(PFVoid) *)saveObjectLocallyAsync:(PFObject *)object includeChildren:(BOOL)includeChildren { +- (BFTask *)saveObjectLocallyAsync:(PFObject *)object includeChildren:(BOOL)includeChildren { //TODO: (nlutsenko) Remove this method, replace with LocalStore implementation that wraps OfflineStore + Pin. return [self _performDatabaseTransactionAsyncWithBlock:^BFTask *(PFSQLiteDatabase *database) { return [self saveObjectLocallyAsync:object includeChildren:includeChildren database:database]; }]; } -- (BFTask PF_GENERIC(PFVoid) *)saveObjectLocallyAsync:(PFObject *)object withChildren:(NSArray PF_GENERIC(PFObject *)*)children { +- (BFTask *)saveObjectLocallyAsync:(PFObject *)object withChildren:(NSArray *)children { return [self _performDatabaseTransactionAsyncWithBlock:^BFTask *(PFSQLiteDatabase *database) { return [self saveObjectLocallyAsync:object withChildren:children database:database]; }]; } -- (BFTask PF_GENERIC(PFVoid) *)saveObjectLocallyAsync:(PFObject *)object - includeChildren:(BOOL)includeChildren - database:(PFSQLiteDatabase *)database { +- (BFTask *)saveObjectLocallyAsync:(PFObject *)object + includeChildren:(BOOL)includeChildren + database:(PFSQLiteDatabase *)database { //TODO: (nlutsenko) Remove this method, replace with LocalStore implementation that wraps OfflineStore + Pin. - NSMutableArray PF_GENERIC(PFObject *)*children = nil; + NSMutableArray *children = nil; if (includeChildren) { children = [NSMutableArray array]; [PFInternalUtils traverseObject:object usingBlock:^id(id traversedObject) { @@ -321,11 +321,11 @@ - (instancetype)initWithFileManager:(PFFileManager *)fileManager options:(PFOffl return [self saveObjectLocallyAsync:object withChildren:children database:database]; } -- (BFTask PF_GENERIC(PFVoid) *)saveObjectLocallyAsync:(PFObject *)object - withChildren:(NSArray PF_GENERIC(PFObject *)*)children - database:(PFSQLiteDatabase *)database { +- (BFTask *)saveObjectLocallyAsync:(PFObject *)object + withChildren:(NSArray *)children + database:(PFSQLiteDatabase *)database { //TODO (nlutsenko): Add assert that checks whether all children are actually children of an object. - NSMutableArray PF_GENERIC(PFObject *)*objectsInTree = nil; + NSMutableArray *objectsInTree = nil; if (children == nil) { objectsInTree = [NSMutableArray arrayWithObject:object]; } else { @@ -336,7 +336,7 @@ - (instancetype)initWithFileManager:(PFFileManager *)fileManager options:(PFOffl } // Call saveObjectLocallyAsync for each of them individually - NSMutableArray PF_GENERIC(BFTask *)*tasks = [NSMutableArray array]; + NSMutableArray *> *tasks = [NSMutableArray array]; for (PFObject *objInTree in objectsInTree) { [tasks addObject:[self fetchObjectLocallyAsync:objInTree database:database]]; } @@ -358,7 +358,7 @@ - (instancetype)initWithFileManager:(PFFileManager *)fileManager options:(PFOffl }] continueWithSuccessBlock:^id(BFTask *task) { NSString *uuid = task.result; - NSMutableArray PF_GENERIC(BFTask *)*tasks = [NSMutableArray array]; + NSMutableArray *>*tasks = [NSMutableArray array]; for (PFObject *object in objectsInTree) { [tasks addObject:[self saveObjectLocallyAsync:object key:uuid database:database]]; } @@ -367,9 +367,9 @@ - (instancetype)initWithFileManager:(PFFileManager *)fileManager options:(PFOffl }]; } -- (BFTask PF_GENERIC(PFVoid) *)saveObjectLocallyAsync:(PFObject *)object - key:(NSString *)key - database:(PFSQLiteDatabase *)database { +- (BFTask *)saveObjectLocallyAsync:(PFObject *)object + key:(NSString *)key + database:(PFSQLiteDatabase *)database { if (object.objectId != nil && !object.dataAvailable && ![object _hasChanges] && ![object _hasOutstandingOperations]) { return [BFTask taskWithResult:nil]; @@ -424,15 +424,15 @@ - (instancetype)initWithFileManager:(PFFileManager *)fileManager options:(PFOffl #pragma mark - Find ///-------------------------------------- -- (BFTask PF_GENERIC(NSArray *)*)findAsyncForQueryState:(PFQueryState *)queryState - user:(PFUser *)user - pin:(PFPin *)pin { +- (BFTask *> *)findAsyncForQueryState:(PFQueryState *)queryState + user:(PFUser *)user + pin:(PFPin *)pin { return [self findAsyncForQueryState:queryState user:user pin:pin isCount:NO]; } -- (BFTask PF_GENERIC(NSNumber *)*)countAsyncForQueryState:(PFQueryState *)queryState - user:(PFUser *)user - pin:(PFPin *)pin { +- (BFTask *)countAsyncForQueryState:(PFQueryState *)queryState + user:(PFUser *)user + pin:(PFPin *)pin { return [[self findAsyncForQueryState:queryState user:user pin:pin @@ -465,12 +465,12 @@ - (BFTask *)findAsyncForQueryState:(PFQueryState *)queryState pin:(PFPin *)pin isCount:(BOOL)isCount database:(PFSQLiteDatabase *)database { - __block NSMutableArray PF_GENERIC(PFObject *)*mutableResults = [NSMutableArray array]; + __block NSMutableArray *mutableResults = [NSMutableArray array]; BFTask *queryTask = nil; BOOL includeIsDeletingEventually = queryState.shouldIncludeDeletingEventually; __block NSString *queryString = nil; - __block NSArray PF_GENERIC(NSString *)*queryArguments = nil; + __block NSArray *queryArguments = nil; if (!pin) { NSString *isDeletingEventuallyQuery = @""; @@ -513,23 +513,23 @@ - (BFTask *)findAsyncForQueryState:(PFQueryState *)queryState @weakify(self); return [[queryTask continueWithSuccessBlock:^id(BFTask *task) { return [[database executeQueryAsync:queryString withArgumentsInArray:queryArguments block:^id(PFSQLiteDatabaseResult *result) { - NSMutableArray PF_GENERIC(NSString *)*uuids = [NSMutableArray array]; + NSMutableArray *uuids = [NSMutableArray array]; while ([result next]) { NSString *uuid = [result stringForColumnIndex:0]; [uuids addObject:uuid]; } return uuids; - }] continueWithSuccessBlock:^id(BFTask PF_GENERIC(NSArray *)*task) { + }] continueWithSuccessBlock:^id(BFTask *> *task) { @strongify(self); PFConstraintMatcherBlock matcherBlock = [self.offlineQueryLogic createMatcherForQueryState:queryState user:user]; BFTask *checkAllTask = [BFTask taskWithResult:nil]; - NSArray PF_GENERIC(NSArray *)*uuidBatches = [PFInternalUtils arrayBySplittingArray:task.result - withMaximumComponentsPerSegment:64]; - for (NSArray PF_GENERIC(NSString *)*uuids in uuidBatches) { + NSArray *> *uuidBatches = [PFInternalUtils arrayBySplittingArray:task.result + withMaximumComponentsPerSegment:64]; + for (NSArray *uuids in uuidBatches) { checkAllTask = [[checkAllTask continueWithSuccessBlock:^id(BFTask *_) { return [self _getObjectPointersAsyncWithUUIDs:uuids fromDatabase:database]; - }] continueWithSuccessBlock:^id(BFTask PF_GENERIC(NSArray *)*task) { + }] continueWithSuccessBlock:^id(BFTask *> *task) { BFTask *checkBatchTask = [BFTask taskWithResult:nil]; for (PFObject *object in task.result) { checkBatchTask = [[[checkBatchTask continueWithSuccessBlock:^id(BFTask *_) { @@ -560,9 +560,9 @@ NSArray PF_GENERIC(NSArray *)*uuidBatches = [PFInternalUtils arrayBy if (!isCount) { queryOptions = PFOfflineQueryOptionOrder | PFOfflineQueryOptionSkip | PFOfflineQueryOptionLimit; } - NSArray PF_GENERIC(PFObject *)*results = [self.offlineQueryLogic resultsByApplyingOptions:queryOptions - ofQueryState:queryState - toResults:mutableResults]; + NSArray *results = [self.offlineQueryLogic resultsByApplyingOptions:queryOptions + ofQueryState:queryState + toResults:mutableResults]; // Fetch includes BFTask *fetchIncludesTask = [self.offlineQueryLogic fetchIncludesAsyncForResults:results @@ -579,7 +579,7 @@ NSArray PF_GENERIC(PFObject *)*results = [self.offlineQueryLogic resultsByApplyi #pragma mark - Update ///-------------------------------------- -- (BFTask PF_GENERIC(PFVoid) *)updateDataForObjectAsync:(PFObject *)object { +- (BFTask *)updateDataForObjectAsync:(PFObject *)object { BFTask *fetchTask = nil; @synchronized(self.lock) { @@ -606,7 +606,7 @@ NSArray PF_GENERIC(PFObject *)*results = [self.offlineQueryLogic resultsByApplyi }]; } -- (BFTask PF_GENERIC(PFVoid) *)_updateDataForObjectAsync:(PFObject *)object inDatabase:(PFSQLiteDatabase *)database { +- (BFTask *)_updateDataForObjectAsync:(PFObject *)object inDatabase:(PFSQLiteDatabase *)database { BFTask *uuidTask = nil; @synchronized(self.lock) { uuidTask = [self.objectToUUIDMap objectForKey:object]; @@ -658,17 +658,17 @@ NSArray PF_GENERIC(PFObject *)*results = [self.offlineQueryLogic resultsByApplyi #pragma mark - Delete ///-------------------------------------- -- (BFTask PF_GENERIC(PFVoid) *)deleteDataForObjectAsync:(PFObject *)object { +- (BFTask *)deleteDataForObjectAsync:(PFObject *)object { return [self _performDatabaseTransactionAsyncWithBlock:^BFTask *(PFSQLiteDatabase *database) { return [self deleteDataForObjectAsync:object database:database]; }]; } -- (BFTask PF_GENERIC(PFVoid) *)deleteDataForObjectAsync:(PFObject *)object database:(PFSQLiteDatabase *)database { +- (BFTask *)deleteDataForObjectAsync:(PFObject *)object database:(PFSQLiteDatabase *)database { __block NSString *uuid = nil; // Make sure the object has a UUID. - BFTask PF_GENERIC(NSString *)*uuidTask = nil; + BFTask *uuidTask = nil; @synchronized(self.lock) { uuidTask = [self.objectToUUIDMap objectForKey:object]; if (!uuidTask) { @@ -689,25 +689,25 @@ NSArray PF_GENERIC(PFObject *)*results = [self.offlineQueryLogic resultsByApplyi PFOfflineStoreKeyOfKey, PFOfflineStoreTableOfDependencies, PFOfflineStoreKeyOfUUID]; return [database executeQueryAsync:sql withArgumentsInArray:@[ uuid ] block:^id(PFSQLiteDatabaseResult *result) { - NSMutableArray PF_GENERIC(NSString *)*uuids = [NSMutableArray array]; + NSMutableArray *uuids = [NSMutableArray array]; while (result.next) { NSString *uuid = [result stringForColumnIndex:0]; [uuids addObject:uuid]; } return uuids; }]; - }] continueWithSuccessBlock:^id(BFTask PF_GENERIC(NSArray *)*task) { + }] continueWithSuccessBlock:^id(BFTask *> *task) { // Try to unpin this object from the pin label if it's a root of the PFPin. - NSMutableArray PF_GENERIC(BFTask *)*tasks = [NSMutableArray array]; + NSMutableArray *> *tasks = [NSMutableArray array]; for (NSString *uuid in task.result) { BFTask *getPointerTask = [self _getPointerAsyncWithUUID:uuid database:database]; - BFTask *objectUnpinTask = [[getPointerTask continueWithSuccessBlock:^id(BFTask PF_GENERIC(PFPin *)*task) { + BFTask *objectUnpinTask = [[getPointerTask continueWithSuccessBlock:^id(BFTask *task) { return [self fetchObjectLocallyAsync:task.result database:database]; - }] continueWithBlock:^id(BFTask PF_GENERIC(PFPin *)*task) { + }] continueWithBlock:^id(BFTask *task) { PFPin *pin = task.result; - NSMutableArray PF_GENERIC(PFObject *)*modified = pin.objects; + NSMutableArray *modified = pin.objects; if (!modified || ![modified containsObject:object]) { return task; } @@ -754,7 +754,7 @@ NSArray PF_GENERIC(PFObject *)*results = [self.offlineQueryLogic resultsByApplyi #pragma mark - Unpin ///-------------------------------------- -- (BFTask PF_GENERIC(PFVoid) *)unpinObjectAsync:(PFObject *)object { +- (BFTask *)unpinObjectAsync:(PFObject *)object { BFTask *uuidTask = [self.objectToUUIDMap objectForKey:object]; return [uuidTask continueWithBlock:^id(BFTask *task) { NSString *uuid = task.result; @@ -766,14 +766,14 @@ NSArray PF_GENERIC(PFObject *)*results = [self.offlineQueryLogic resultsByApplyi }]; } -- (BFTask PF_GENERIC(PFVoid) *)_unpinKeyAsync:(NSString *)key { +- (BFTask *)_unpinKeyAsync:(NSString *)key { return [self _performDatabaseTransactionAsyncWithBlock:^BFTask *(PFSQLiteDatabase *database) { return [self _unpinKeyAsync:key database:database]; }]; } -- (BFTask PF_GENERIC(PFVoid) *)_unpinKeyAsync:(NSString *)key database:(PFSQLiteDatabase *)database { - NSMutableArray PF_GENERIC(NSString *)*uuids = [NSMutableArray array]; +- (BFTask *)_unpinKeyAsync:(NSString *)key database:(PFSQLiteDatabase *)database { + NSMutableArray *uuids = [NSMutableArray array]; // Fetch all uuids from Dependencies for key=? grouped by uuid having a count of 1 NSString *query = [NSString stringWithFormat:@"SELECT %@ FROM %@ WHERE %@ = ? AND %@ IN " @@ -791,7 +791,7 @@ NSArray PF_GENERIC(PFObject *)*results = [self.offlineQueryLogic resultsByApplyi [uuids addObject:[result stringForColumnIndex:0]]; } return uuids; - }] continueWithSuccessBlock:^id(BFTask PF_GENERIC(NSArray *)*task) { + }] continueWithSuccessBlock:^id(BFTask *> *task) { // DELETE FROM Objects return [self _deleteObjectsWithUUIDs:task.result database:database]; }] continueWithSuccessBlock:^id(BFTask *_) { @@ -814,7 +814,7 @@ NSArray PF_GENERIC(PFObject *)*results = [self.offlineQueryLogic resultsByApplyi }]; } -- (BFTask PF_GENERIC(PFVoid) *)_deleteObjectsWithUUIDs:(NSArray PF_GENERIC(NSString *)*)uuids database:(PFSQLiteDatabase *)database { +- (BFTask *)_deleteObjectsWithUUIDs:(NSArray *)uuids database:(PFSQLiteDatabase *)database { if (uuids.count <= 0) { return [BFTask taskWithResult:nil]; } @@ -829,7 +829,7 @@ NSArray PF_GENERIC(PFObject *)*results = [self.offlineQueryLogic resultsByApplyi }]; } - NSMutableArray PF_GENERIC(NSString *)*placeholders = [NSMutableArray array]; + NSMutableArray *placeholders = [NSMutableArray array]; for (int i = 0; i < uuids.count; ++i) { [placeholders addObject:@"?"]; } @@ -844,8 +844,8 @@ NSArray PF_GENERIC(PFObject *)*results = [self.offlineQueryLogic resultsByApplyi #pragma mark - Internal Helper Methods ///-------------------------------------- -- (BFTask PF_GENERIC(NSString *)*)getOrCreateUUIDAsyncForObject:(PFObject *)object - database:(PFSQLiteDatabase *)database { +- (BFTask *)getOrCreateUUIDAsyncForObject:(PFObject *)object + database:(PFSQLiteDatabase *)database { NSString *newUUID = [NSUUID UUID].UUIDString; BFTaskCompletionSource *tcs = [BFTaskCompletionSource taskCompletionSource]; @@ -893,7 +893,7 @@ NSArray PF_GENERIC(PFObject *)*results = [self.offlineQueryLogic resultsByApplyi @param database The database instance to retrieve from. @return The object with that UUID. */ -- (BFTask PF_GENERIC(PFObject *)*)_getPointerAsyncWithUUID:(NSString *)uuid database:(PFSQLiteDatabase *)database { +- (BFTask *)_getPointerAsyncWithUUID:(NSString *)uuid database:(PFSQLiteDatabase *)database { @synchronized(self.lock) { PFObject *existing = [self.UUIDToObjectMap objectForKey:uuid]; if (existing) { @@ -926,10 +926,10 @@ NSArray PF_GENERIC(PFObject *)*results = [self.offlineQueryLogic resultsByApplyi }]; } -- (BFTask PF_GENERIC(NSArray *)*)_getObjectPointersAsyncWithUUIDs:(NSArray PF_GENERIC(NSString *)*)uuids - fromDatabase:(PFSQLiteDatabase *)database { - NSMutableArray PF_GENERIC(PFObject *)*objects = [NSMutableArray array]; - NSMutableArray PF_GENERIC(NSString *)*missingUUIDs = [NSMutableArray array]; +- (BFTask *> *)_getObjectPointersAsyncWithUUIDs:(NSArray *)uuids + fromDatabase:(PFSQLiteDatabase *)database { + NSMutableArray *objects = [NSMutableArray array]; + NSMutableArray *missingUUIDs = [NSMutableArray array]; @synchronized(self.lock) { for (NSString *uuid in uuids) { PFObject *object = [self.UUIDToObjectMap objectForKey:uuid]; @@ -947,7 +947,7 @@ NSArray PF_GENERIC(PFObject *)*results = [self.offlineQueryLogic resultsByApplyi PFOfflineStoreTableOfObjects, PFOfflineStoreKeyOfUUID, [missingUUIDs componentsJoinedByString:@"','"]]; - NSMutableArray PF_GENERIC(BFTask *)*fetchPointersTasks = [NSMutableArray arrayWithCapacity:missingUUIDs.count]; + NSMutableArray *> *fetchPointersTasks = [NSMutableArray arrayWithCapacity:missingUUIDs.count]; return [[database executeQueryAsync:queryString withArgumentsInArray:nil block:^id(PFSQLiteDatabaseResult *result) { while ([result next]) { NSString *uuid = [result stringForColumnIndex:0]; @@ -960,16 +960,16 @@ NSArray PF_GENERIC(PFObject *)*results = [self.offlineQueryLogic resultsByApplyi } return [BFTask taskForCompletionOfAllTasks:fetchPointersTasks]; }] continueWithSuccessBlock:^id(BFTask *_) { - for (BFTask PF_GENERIC(PFObject *)*task in fetchPointersTasks) { + for (BFTask *task in fetchPointersTasks) { [objects addObject:task.result]; } return objects; }]; } -- (BFTask PF_GENERIC(PFObject *)*)_getOrCreateInMemoryPointerForObjectWithUUID:(NSString *)uuid - parseClassName:(NSString *)parseClassName - objectId:(NSString *)objectId { +- (BFTask *)_getOrCreateInMemoryPointerForObjectWithUUID:(NSString *)uuid + parseClassName:(NSString *)parseClassName + objectId:(NSString *)objectId { PFObject *pointer = nil; @synchronized(self.lock) { pointer = [self.UUIDToObjectMap objectForKey:uuid]; @@ -1063,7 +1063,7 @@ + (NSString *)PFOfflineStoreDependenciesTableSchema { PFOfflineStoreKeyOfUUID]; } -+ (BFTask PF_GENERIC(PFVoid) *)_initializeTablesInBackgroundWithDatabaseController:(PFSQLiteDatabaseController *)databaseController { ++ (BFTask *)_initializeTablesInBackgroundWithDatabaseController:(PFSQLiteDatabaseController *)databaseController { return [[databaseController openDatabaseWithNameAsync:PFOfflineStoreDatabaseName] continueWithBlock:^id(BFTask *task) { PFSQLiteDatabase *database = task.result; return [[[[[database beginTransactionAsync] continueWithSuccessBlock:^id(BFTask *task) { @@ -1082,7 +1082,7 @@ + (NSString *)PFOfflineStoreDependenciesTableSchema { #pragma mark - Database Helpers ///-------------------------------------- -- (BFTask PF_GENERIC(PFVoid) *)_performDatabaseTransactionAsyncWithBlock:(PFOfflineStoreDatabaseExecutionBlock)block { +- (BFTask *)_performDatabaseTransactionAsyncWithBlock:(PFOfflineStoreDatabaseExecutionBlock)block { return [self _performDatabaseOperationAsyncWithBlock:^BFTask *(PFSQLiteDatabase *database) { BFTask *task = [database beginTransactionAsync]; task = [task continueWithSuccessBlock:^id(BFTask *task) { @@ -1094,7 +1094,7 @@ + (NSString *)PFOfflineStoreDependenciesTableSchema { }]; } -- (BFTask PF_GENERIC(PFVoid) *)_performDatabaseOperationAsyncWithBlock:(PFOfflineStoreDatabaseExecutionBlock)block { +- (BFTask *)_performDatabaseOperationAsyncWithBlock:(PFOfflineStoreDatabaseExecutionBlock)block { return [[self.databaseController openDatabaseWithNameAsync:PFOfflineStoreDatabaseName] continueWithBlock:^id(BFTask *task) { PFSQLiteDatabase *database = task.result; return [block(database) continueWithBlock:^id(BFTask *task) { diff --git a/Parse/Internal/LocalDataStore/SQLite/PFSQLiteDatabase.h b/Parse/Internal/LocalDataStore/SQLite/PFSQLiteDatabase.h index 28160af2f..b4d057a65 100644 --- a/Parse/Internal/LocalDataStore/SQLite/PFSQLiteDatabase.h +++ b/Parse/Internal/LocalDataStore/SQLite/PFSQLiteDatabase.h @@ -13,7 +13,7 @@ #import "PFMacros.h" -@class BFTask PF_GENERIC(__covariant BFGenericType); +@class BFTask<__covariant BFGenericType>; @class PFFileManager; @class PFSQLiteDatabaseResult; diff --git a/Parse/Internal/LocalDataStore/SQLite/PFSQLiteDatabase.m b/Parse/Internal/LocalDataStore/SQLite/PFSQLiteDatabase.m index 756f7adb8..b63fc6d79 100644 --- a/Parse/Internal/LocalDataStore/SQLite/PFSQLiteDatabase.m +++ b/Parse/Internal/LocalDataStore/SQLite/PFSQLiteDatabase.m @@ -178,7 +178,7 @@ - (BFTask *)rollbackAsync { #pragma mark - Query Methods ///-------------------------------------- -- (BFTask PF_GENERIC(PFSQLiteDatabaseResult *)*)_executeQueryAsync:(NSString *)sql withArgumentsInArray:(NSArray *)args cachingEnabled:(BOOL)enableCaching { +- (BFTask *)_executeQueryAsync:(NSString *)sql withArgumentsInArray:(NSArray *)args cachingEnabled:(BOOL)enableCaching { int resultCode = 0; PFSQLiteStatement *statement = enableCaching ? [self _cachedStatementForQuery:sql] : nil; if (!statement) { @@ -228,8 +228,8 @@ - (BFTask *)executeCachedQueryAsync:(NSString *)sql withArgumentsInArray:(NSArra - (BFTask *)executeQueryAsync:(NSString *)query withArgumentsInArray:(nullable NSArray *)args block:(PFSQLiteDatabaseQueryBlock)block { return [BFTask taskFromExecutor:_databaseExecutor withBlock:^id { - BFTask PF_GENERIC(PFSQLiteDatabaseResult *)*task = [self _executeQueryAsync:query withArgumentsInArray:args cachingEnabled:NO]; - return [[task continueImmediatelyWithSuccessBlock:^id(BFTask PF_GENERIC(PFSQLiteDatabaseResult *)*task) { + BFTask *task = [self _executeQueryAsync:query withArgumentsInArray:args cachingEnabled:NO]; + return [[task continueImmediatelyWithSuccessBlock:^id(BFTask *task) { return block(task.result); }] continueImmediatelyWithBlock:^id(BFTask *resultTask) { [task.result close]; diff --git a/Parse/Internal/LocalDataStore/SQLite/PFSQLiteDatabaseController.h b/Parse/Internal/LocalDataStore/SQLite/PFSQLiteDatabaseController.h index 13ef378f5..92f6d4952 100644 --- a/Parse/Internal/LocalDataStore/SQLite/PFSQLiteDatabaseController.h +++ b/Parse/Internal/LocalDataStore/SQLite/PFSQLiteDatabaseController.h @@ -11,7 +11,7 @@ #import -@class BFTask PF_GENERIC(__covariant BFGenericType); +@class BFTask<__covariant BFGenericType>; @class PFFileManager; @class PFSQLiteDatabase; diff --git a/Parse/Internal/Object/BatchController/PFObjectBatchController.h b/Parse/Internal/Object/BatchController/PFObjectBatchController.h index a513f6d9a..474c8962e 100644 --- a/Parse/Internal/Object/BatchController/PFObjectBatchController.h +++ b/Parse/Internal/Object/BatchController/PFObjectBatchController.h @@ -14,7 +14,7 @@ #import "PFDataProvider.h" #import "PFMacros.h" -@class BFTask PF_GENERIC(__covariant BFGenericType); +@class BFTask<__covariant BFGenericType>; @class PFObject; NS_ASSUME_NONNULL_BEGIN diff --git a/Parse/Internal/Object/Controller/PFObjectController.h b/Parse/Internal/Object/Controller/PFObjectController.h index 44a8ac60b..01358a404 100644 --- a/Parse/Internal/Object/Controller/PFObjectController.h +++ b/Parse/Internal/Object/Controller/PFObjectController.h @@ -12,8 +12,7 @@ #import "PFDataProvider.h" #import "PFObjectControlling.h" - -@class BFTask PF_GENERIC(__covariant BFGenericType); +@class BFTask<__covariant BFGenericType>; @class PFObject; NS_ASSUME_NONNULL_BEGIN diff --git a/Parse/Internal/Object/Controller/PFObjectControlling.h b/Parse/Internal/Object/Controller/PFObjectControlling.h index dcb6c1e55..6f9075630 100644 --- a/Parse/Internal/Object/Controller/PFObjectControlling.h +++ b/Parse/Internal/Object/Controller/PFObjectControlling.h @@ -13,7 +13,7 @@ #import "PFMacros.h" -@class BFTask PF_GENERIC(__covariant BFGenericType); +@class BFTask<__covariant BFGenericType>; @class PFObject; NS_ASSUME_NONNULL_BEGIN diff --git a/Parse/Internal/Object/CurrentController/PFCurrentObjectControlling.h b/Parse/Internal/Object/CurrentController/PFCurrentObjectControlling.h index 9cbd1b078..defd81cea 100644 --- a/Parse/Internal/Object/CurrentController/PFCurrentObjectControlling.h +++ b/Parse/Internal/Object/CurrentController/PFCurrentObjectControlling.h @@ -13,7 +13,7 @@ NS_ASSUME_NONNULL_BEGIN -@class BFTask PF_GENERIC(__covariant BFGenericType); +@class BFTask<__covariant BFGenericType>; @class PFObject; typedef NS_ENUM(NSUInteger, PFCurrentObjectStorageType) { diff --git a/Parse/Internal/Object/FilePersistence/PFObjectFilePersistenceController.h b/Parse/Internal/Object/FilePersistence/PFObjectFilePersistenceController.h index 87f43529d..20dd41a08 100644 --- a/Parse/Internal/Object/FilePersistence/PFObjectFilePersistenceController.h +++ b/Parse/Internal/Object/FilePersistence/PFObjectFilePersistenceController.h @@ -14,7 +14,7 @@ #import "PFDataProvider.h" #import "PFMacros.h" -@class BFTask PF_GENERIC(__covariant BFGenericType); +@class BFTask<__covariant BFGenericType>; @class PFObject; @interface PFObjectFilePersistenceController : NSObject @@ -40,7 +40,7 @@ @return `BFTask` with `PFObject` or `nil` result. */ -- (BFTask PF_GENERIC(PFObject *)*)loadPersistentObjectAsyncForKey:(NSString *)key; +- (BFTask *)loadPersistentObjectAsyncForKey:(NSString *)key; /** Saves a given object to a file with name. diff --git a/Parse/Internal/Object/FilePersistence/PFObjectFilePersistenceController.m b/Parse/Internal/Object/FilePersistence/PFObjectFilePersistenceController.m index aa2935b86..a47b84b00 100644 --- a/Parse/Internal/Object/FilePersistence/PFObjectFilePersistenceController.m +++ b/Parse/Internal/Object/FilePersistence/PFObjectFilePersistenceController.m @@ -44,8 +44,8 @@ + (instancetype)controllerWithDataSource:(id)da #pragma mark - Objects ///-------------------------------------- -- (BFTask PF_GENERIC(PFObject *)*)loadPersistentObjectAsyncForKey:(NSString *)key { - return [[self _getPersistenceGroupAsync] continueWithSuccessBlock:^id(BFTask PF_GENERIC(id)*task) { +- (BFTask *)loadPersistentObjectAsyncForKey:(NSString *)key { + return [[self _getPersistenceGroupAsync] continueWithSuccessBlock:^id(BFTask> *task) { id group = task.result; __block PFObject *object = nil; return [[[[[group beginLockedContentAccessAsyncToDataForKey:key] continueWithSuccessBlock:^id(BFTask *_) { @@ -66,7 +66,7 @@ + (instancetype)controllerWithDataSource:(id)da } - (BFTask *)persistObjectAsync:(PFObject *)object forKey:(NSString *)key { - return [[self _getPersistenceGroupAsync] continueWithSuccessBlock:^id(BFTask PF_GENERIC(id)*task) { + return [[self _getPersistenceGroupAsync] continueWithSuccessBlock:^id(BFTask> *task) { id group = task.result; return [[[group beginLockedContentAccessAsyncToDataForKey:key] continueWithSuccessBlock:^id(BFTask *_) { NSData *data = [PFObjectFileCoder dataFromObject:object usingEncoder:[PFPointerObjectEncoder objectEncoder]]; @@ -78,7 +78,7 @@ - (BFTask *)persistObjectAsync:(PFObject *)object forKey:(NSString *)key { } - (BFTask *)removePersistentObjectAsyncForKey:(NSString *)key { - return [[self _getPersistenceGroupAsync] continueWithSuccessBlock:^id(BFTask PF_GENERIC(id)*task) { + return [[self _getPersistenceGroupAsync] continueWithSuccessBlock:^id(BFTask> *task) { id group = task.result; return [[[group beginLockedContentAccessAsyncToDataForKey:key] continueWithSuccessBlock:^id(BFTask *_) { return [group removeDataAsyncForKey:key]; @@ -92,7 +92,7 @@ - (BFTask *)removePersistentObjectAsyncForKey:(NSString *)key { #pragma mark - Private ///-------------------------------------- -- (BFTask PF_GENERIC(id) *)_getPersistenceGroupAsync { +- (BFTask> *)_getPersistenceGroupAsync { return [self.dataSource.persistenceController getPersistenceGroupAsync]; } diff --git a/Parse/Internal/Object/PFObjectPrivate.h b/Parse/Internal/Object/PFObjectPrivate.h index 03943a4c1..16e39e378 100644 --- a/Parse/Internal/Object/PFObjectPrivate.h +++ b/Parse/Internal/Object/PFObjectPrivate.h @@ -18,7 +18,7 @@ #import "PFMulticastDelegate.h" #import "PFObjectControlling.h" -@class BFTask PF_GENERIC(__covariant BFGenericType); +@class BFTask<__covariant BFGenericType>; @class PFCurrentUserController; @class PFFieldOperation; @class PFJSONCacheItem; @@ -110,8 +110,8 @@ /// @name Validation ///-------------------------------------- -- (BFTask PF_GENERIC(PFVoid) *)_validateFetchAsync NS_REQUIRES_SUPER; -- (BFTask PF_GENERIC(PFVoid) *)_validateDeleteAsync NS_REQUIRES_SUPER; +- (BFTask *)_validateFetchAsync NS_REQUIRES_SUPER; +- (BFTask *)_validateDeleteAsync NS_REQUIRES_SUPER; /** Validate the save eventually operation with the current state. @@ -119,7 +119,7 @@ @return Task that encapsulates the validation. */ -- (BFTask PF_GENERIC(PFVoid) *)_validateSaveEventuallyAsync NS_REQUIRES_SUPER; +- (BFTask *)_validateSaveEventuallyAsync NS_REQUIRES_SUPER; ///-------------------------------------- /// @name Pin diff --git a/Parse/Internal/Object/PinningStore/PFPinningObjectStore.h b/Parse/Internal/Object/PinningStore/PFPinningObjectStore.h index a3a1a4dd0..126bbb403 100644 --- a/Parse/Internal/Object/PinningStore/PFPinningObjectStore.h +++ b/Parse/Internal/Object/PinningStore/PFPinningObjectStore.h @@ -16,7 +16,7 @@ NS_ASSUME_NONNULL_BEGIN -@class BFTask PF_GENERIC(__covariant BFGenericType); +@class BFTask<__covariant BFGenericType>; @class PFPin; @interface PFPinningObjectStore : NSObject @@ -42,7 +42,7 @@ NS_ASSUME_NONNULL_BEGIN @return `BFTask` with `PFPin` result if pinning succeeds. */ -- (BFTask PF_GENERIC(PFPin *)*)fetchPinAsyncWithName:(NSString *)name; +- (BFTask *)fetchPinAsyncWithName:(NSString *)name; /** Pins given objects to the pin. Creates new pin if the pin with such name is not found. @@ -53,9 +53,9 @@ NS_ASSUME_NONNULL_BEGIN @return `BFTask` with no result. */ -- (BFTask PF_GENERIC(PFVoid)*)pinObjectsAsync:(nullable NSArray *)objects - withPinName:(NSString *)name - includeChildren:(BOOL)includeChildren; +- (BFTask *)pinObjectsAsync:(nullable NSArray *)objects + withPinName:(NSString *)name + includeChildren:(BOOL)includeChildren; ///-------------------------------------- /// @name Unpin @@ -69,7 +69,7 @@ NS_ASSUME_NONNULL_BEGIN @return `BFTask` with no result. */ -- (BFTask PF_GENERIC(PFVoid)*)unpinObjectsAsync:(nullable NSArray *)objects withPinName:(NSString *)name; +- (BFTask *)unpinObjectsAsync:(nullable NSArray *)objects withPinName:(NSString *)name; /** Unpins all objects from the pin. @@ -78,7 +78,7 @@ NS_ASSUME_NONNULL_BEGIN @return `BFTask` with no result. */ -- (BFTask PF_GENERIC(PFVoid)*)unpinAllObjectsAsyncWithPinName:(NSString *)name; +- (BFTask *)unpinAllObjectsAsyncWithPinName:(NSString *)name; @end diff --git a/Parse/Internal/Object/PinningStore/PFPinningObjectStore.m b/Parse/Internal/Object/PinningStore/PFPinningObjectStore.m index d0bd13d79..259a4b5b4 100644 --- a/Parse/Internal/Object/PinningStore/PFPinningObjectStore.m +++ b/Parse/Internal/Object/PinningStore/PFPinningObjectStore.m @@ -17,7 +17,7 @@ #import "PFQueryPrivate.h" @interface PFPinningObjectStore () { - NSMapTable PF_GENERIC(NSString *, BFTask*)*_pinCacheTable; + NSMapTable *> *_pinCacheTable; dispatch_queue_t _pinCacheAccessQueue; BFExecutor *_pinCacheAccessExecutor; } @@ -55,7 +55,7 @@ + (instancetype)storeWithDataSource:(id)dataSource { #pragma mark - Pin ///-------------------------------------- -- (BFTask PF_GENERIC(PFPin *)*)fetchPinAsyncWithName:(NSString *)name { +- (BFTask *)fetchPinAsyncWithName:(NSString *)name { @weakify(self); return [BFTask taskFromExecutor:_pinCacheAccessExecutor withBlock:^id{ BFTask *cachedTask = [_pinCacheTable objectForKey:name] ?: [BFTask taskWithResult:nil]; @@ -79,7 +79,7 @@ + (instancetype)storeWithDataSource:(id)dataSource { }]; } -- (BFTask PF_GENERIC(PFVoid) *)pinObjectsAsync:(NSArray *)objects withPinName:(NSString *)name includeChildren:(BOOL)includeChildren { +- (BFTask *)pinObjectsAsync:(NSArray *)objects withPinName:(NSString *)name includeChildren:(BOOL)includeChildren { if (objects.count == 0) { return [BFTask taskWithResult:nil]; } @@ -120,7 +120,7 @@ + (instancetype)storeWithDataSource:(id)dataSource { #pragma mark - Unpin ///-------------------------------------- -- (BFTask PF_GENERIC(PFVoid) *)unpinObjectsAsync:(NSArray *)objects withPinName:(NSString *)name { +- (BFTask *)unpinObjectsAsync:(NSArray *)objects withPinName:(NSString *)name { if (objects.count == 0) { return [BFTask taskWithResult:nil]; } @@ -151,7 +151,7 @@ + (instancetype)storeWithDataSource:(id)dataSource { }]; } -- (BFTask PF_GENERIC(PFVoid)*)unpinAllObjectsAsyncWithPinName:(NSString *)name { +- (BFTask *)unpinAllObjectsAsyncWithPinName:(NSString *)name { @weakify(self); return [[self fetchPinAsyncWithName:name] continueWithSuccessBlock:^id(BFTask *task) { @strongify(self); diff --git a/Parse/Internal/PFEncoder.h b/Parse/Internal/PFEncoder.h index 82d22821b..e65aec51f 100644 --- a/Parse/Internal/PFEncoder.h +++ b/Parse/Internal/PFEncoder.h @@ -13,7 +13,7 @@ #import "PFMacros.h" -@class BFTask PF_GENERIC(__covariant BFGenericType); +@class BFTask<__covariant BFGenericType>; @class PFObject; @class PFOfflineStore; @class PFSQLiteDatabase; diff --git a/Parse/Internal/PFEventuallyPin.h b/Parse/Internal/PFEventuallyPin.h index d5086b844..f6d1dd4da 100644 --- a/Parse/Internal/PFEventuallyPin.h +++ b/Parse/Internal/PFEventuallyPin.h @@ -13,7 +13,7 @@ #import #import -@class BFTask PF_GENERIC(__covariant BFGenericType); +@class BFTask<__covariant BFGenericType>; @protocol PFNetworkCommand; extern NSString *const PFEventuallyPinPinName; diff --git a/Parse/Internal/PFEventuallyQueue.h b/Parse/Internal/PFEventuallyQueue.h index 0119ece7f..f3224308c 100644 --- a/Parse/Internal/PFEventuallyQueue.h +++ b/Parse/Internal/PFEventuallyQueue.h @@ -14,7 +14,7 @@ #import "PFMacros.h" #import "PFNetworkCommand.h" -@class BFTask PF_GENERIC(__covariant BFGenericType); +@class BFTask<__covariant BFGenericType>; @class PFEventuallyPin; @class PFEventuallyQueueTestHelper; @class PFObject; diff --git a/Parse/Internal/PFFileManager.h b/Parse/Internal/PFFileManager.h index b57f23832..917ab029d 100644 --- a/Parse/Internal/PFFileManager.h +++ b/Parse/Internal/PFFileManager.h @@ -14,7 +14,7 @@ #import "PFMacros.h" @class BFExecutor; -@class BFTask PF_GENERIC(__covariant BFGenericType); +@class BFTask<__covariant BFGenericType>; typedef NS_OPTIONS(uint8_t, PFFileManagerOptions) { PFFileManagerOptionSkipBackup = 1 << 0, diff --git a/Parse/Internal/PFMemoryEventuallyQueue.m b/Parse/Internal/PFMemoryEventuallyQueue.m index cf70d74f7..6ec56ca4c 100644 --- a/Parse/Internal/PFMemoryEventuallyQueue.m +++ b/Parse/Internal/PFMemoryEventuallyQueue.m @@ -17,8 +17,8 @@ @interface PFMemoryEventuallyQueue () { dispatch_queue_t _dataAccessQueue; BFExecutor *_dataAccessExecutor; - NSMutableArray PF_GENERIC(NSString *)*_pendingCommandIdentifiers; - NSMutableDictionary PF_GENERIC(NSString *, id)*_commandsDictionary; + NSMutableArray *_pendingCommandIdentifiers; + NSMutableDictionary> *_commandsDictionary; } @end @@ -73,7 +73,7 @@ - (NSString *)_newIdentifierForCommand:(id)command { return [NSUUID UUID].UUIDString; } -- (NSArray PF_GENERIC(NSString *)*)_pendingCommandIdentifiers { +- (NSArray *)_pendingCommandIdentifiers { __block NSArray *array = nil; dispatch_sync(_dataAccessQueue, ^{ array = [_pendingCommandIdentifiers copy]; diff --git a/Parse/Internal/PFTaskQueue.h b/Parse/Internal/PFTaskQueue.h index c1abcb23a..9aa31274b 100644 --- a/Parse/Internal/PFTaskQueue.h +++ b/Parse/Internal/PFTaskQueue.h @@ -11,7 +11,7 @@ #import -@class BFTask PF_GENERIC(__covariant BFGenericType); +@class BFTask<__covariant BFGenericType>; @interface PFTaskQueue : NSObject diff --git a/Parse/Internal/ParseManager.h b/Parse/Internal/ParseManager.h index e89428fd1..5bab75710 100644 --- a/Parse/Internal/ParseManager.h +++ b/Parse/Internal/ParseManager.h @@ -16,7 +16,7 @@ #import "PFOfflineStore.h" #import "PFMacros.h" -@class BFTask PF_GENERIC(__covariant BFGenericType); +@class BFTask<__covariant BFGenericType>; @class PFAnalyticsController; @class PFCoreManager; @class PFInstallationIdentifierStore; diff --git a/Parse/Internal/Persistence/Group/PFFilePersistenceGroup.m b/Parse/Internal/Persistence/Group/PFFilePersistenceGroup.m index f473c233d..a030915fe 100644 --- a/Parse/Internal/Persistence/Group/PFFilePersistenceGroup.m +++ b/Parse/Internal/Persistence/Group/PFFilePersistenceGroup.m @@ -34,7 +34,7 @@ - (instancetype)initWithStorageDirectoryPath:(NSString *)path #pragma mark - PFPersistenceGroup ///-------------------------------------- -- (BFTask PF_GENERIC(NSData *)*)getDataAsyncForKey:(NSString *)key { +- (BFTask *)getDataAsyncForKey:(NSString *)key { return [BFTask taskFromExecutor:[BFExecutor defaultPriorityBackgroundExecutor] withBlock:^id{ NSString *path = [self _filePathForItemForKey:key]; if (![[NSFileManager defaultManager] fileExistsAtPath:path]) { @@ -100,7 +100,7 @@ - (BFTask *)endLockedContentAccessAsyncToDataForKey:(NSString *)key { return [BFTask taskFromExecutor:[BFExecutor defaultPriorityBackgroundExecutor] withBlock:^id{ NSString *path = [self _filePathForItemForKey:key]; - [[PFMultiProcessFileLockController sharedController] endLockedContentAccessForFileAtPath:path]; + [[PFMultiProcessFileLockController sharedController] endLockedContentAccessForFileAtPath:path]; return nil; }]; } diff --git a/Parse/Internal/Persistence/Group/PFPersistenceGroup.h b/Parse/Internal/Persistence/Group/PFPersistenceGroup.h index 79bdbe68e..60602288d 100644 --- a/Parse/Internal/Persistence/Group/PFPersistenceGroup.h +++ b/Parse/Internal/Persistence/Group/PFPersistenceGroup.h @@ -11,7 +11,7 @@ #import -@class BFTask PF_GENERIC(id); +@class BFTask<__covariant BFGenericType>; NS_ASSUME_NONNULL_BEGIN @@ -21,7 +21,7 @@ NS_ASSUME_NONNULL_BEGIN /// @name Data ///-------------------------------------- -- (BFTask PF_GENERIC(NSData *)*)getDataAsyncForKey:(NSString *)key; +- (BFTask *)getDataAsyncForKey:(NSString *)key; - (BFTask *)setDataAsync:(NSData *)data forKey:(NSString *)key; - (BFTask *)removeDataAsyncForKey:(NSString *)key; diff --git a/Parse/Internal/Persistence/Group/PFUserDefaultsPersistenceGroup.m b/Parse/Internal/Persistence/Group/PFUserDefaultsPersistenceGroup.m index 95b7ba244..cbe8c9052 100644 --- a/Parse/Internal/Persistence/Group/PFUserDefaultsPersistenceGroup.m +++ b/Parse/Internal/Persistence/Group/PFUserDefaultsPersistenceGroup.m @@ -45,7 +45,7 @@ - (instancetype)initWithKey:(NSString *)key userDefaults:(NSUserDefaults *)userD #pragma mark - PFPersistenceGroup ///-------------------------------------- -- (BFTask PF_GENERIC(NSData *)*)getDataAsyncForKey:(NSString *)key { +- (BFTask *)getDataAsyncForKey:(NSString *)key { return [_dataAccessQueue enqueue:^id(BFTask *task) { return [[self _loadUserDefaultsIfNeededAsync] continueWithSuccessBlock:^id(BFTask *task) { return _dataDictionary[key]; diff --git a/Parse/Internal/Persistence/PFPersistenceController.h b/Parse/Internal/Persistence/PFPersistenceController.h index 051123990..2e1cf116c 100644 --- a/Parse/Internal/Persistence/PFPersistenceController.h +++ b/Parse/Internal/Persistence/PFPersistenceController.h @@ -13,7 +13,7 @@ #import "PFPersistenceGroup.h" -@class BFTask PF_GENERIC(id); +@class BFTask<__covariant BFGenericType>; NS_ASSUME_NONNULL_BEGIN @@ -21,7 +21,7 @@ NS_ASSUME_NONNULL_BEGIN /// @name Controller ///-------------------------------------- -typedef BFTask PF_GENERIC(NSNumber *)* __nonnull (^PFPersistenceGroupValidationHandler)(id group); +typedef BFTask *__nonnull (^PFPersistenceGroupValidationHandler)(id group); @interface PFPersistenceController : NSObject @@ -41,7 +41,7 @@ typedef BFTask PF_GENERIC(NSNumber *)* __nonnull (^PFPersistenceGroupValidationH /// @name Data Persistence ///-------------------------------------- -- (BFTask PF_GENERIC(id)*)getPersistenceGroupAsync; +- (BFTask> *)getPersistenceGroupAsync; @end diff --git a/Parse/Internal/Persistence/PFPersistenceController.m b/Parse/Internal/Persistence/PFPersistenceController.m index 22afe4ec8..12251a282 100644 --- a/Parse/Internal/Persistence/PFPersistenceController.m +++ b/Parse/Internal/Persistence/PFPersistenceController.m @@ -52,7 +52,7 @@ - (instancetype)initWithApplicationIdentifier:(nonnull NSString *)applicationIde #pragma mark - Persistence ///-------------------------------------- -- (BFTask PF_GENERIC(id)*)getPersistenceGroupAsync { +- (BFTask> *)getPersistenceGroupAsync { return [_dataQueue enqueue:^id(BFTask *task) { if (_persistenceGroup) { return _persistenceGroup; @@ -65,14 +65,14 @@ - (instancetype)initWithApplicationIdentifier:(nonnull NSString *)applicationIde #pragma mark - Load ///-------------------------------------- -- (BFTask PF_GENERIC(id)*)_loadPersistenceGroup { +- (BFTask> *)_loadPersistenceGroup { return [[BFTask taskFromExecutor:[BFExecutor defaultExecutor] withBlock:^id{ #if TARGET_OS_TV return [self _createUserDefaultsPersistenceGroup]; #else return [self _createFilePersistenceGroup]; #endif - }] continueWithSuccessBlock:^id(BFTask PF_GENERIC(id)*task) { + }] continueWithSuccessBlock:^id(BFTask> *task) { id group = task.result; return [_groupValidationHandler(group) continueWithSuccessBlock:^id(BFTask *_) { _persistenceGroup = group; @@ -85,7 +85,7 @@ - (instancetype)initWithApplicationIdentifier:(nonnull NSString *)applicationIde #pragma mark - File Group ///-------------------------------------- -- (BFTask PF_GENERIC(id)*)_createFilePersistenceGroup { +- (BFTask> *)_createFilePersistenceGroup { return [[BFTask taskFromExecutor:[BFExecutor defaultExecutor] withBlock:^id{ NSString *storagePath = [self _filePersistenceGroupStoragePath]; return [[PFFileManager createDirectoryIfNeededAsyncAtPath:storagePath] continueWithSuccessBlock:^id(BFTask *task) { @@ -126,7 +126,7 @@ - (NSString *)_filePersistenceGroupStoragePath { #pragma mark - UserDefaults Group ///-------------------------------------- -- (BFTask PF_GENERIC(id)*)_createUserDefaultsPersistenceGroup { +- (BFTask> *)_createUserDefaultsPersistenceGroup { return [BFTask taskFromExecutor:[BFExecutor defaultExecutor] withBlock:^id{ return [[PFUserDefaultsPersistenceGroup alloc] initWithKey:PFUserDefaultsPersistenceParseKey]; }]; diff --git a/Parse/Internal/Product/ProductsRequestHandler/PFProductsRequestHandler.h b/Parse/Internal/Product/ProductsRequestHandler/PFProductsRequestHandler.h index ec51b86e9..236138fdf 100644 --- a/Parse/Internal/Product/ProductsRequestHandler/PFProductsRequestHandler.h +++ b/Parse/Internal/Product/ProductsRequestHandler/PFProductsRequestHandler.h @@ -15,7 +15,7 @@ PF_OSX_UNAVAILABLE_WARNING PF_WATCH_UNAVAILABLE_WARNING -@class BFTask PF_GENERIC(__covariant BFGenericType); +@class BFTask<__covariant BFGenericType>; PF_OSX_UNAVAILABLE PF_WATCH_UNAVAILABLE @interface PFProductsRequestResult : NSObject diff --git a/Parse/Internal/Purchase/Controller/PFPurchaseController.h b/Parse/Internal/Purchase/Controller/PFPurchaseController.h index 2a6784f18..05401c44a 100644 --- a/Parse/Internal/Purchase/Controller/PFPurchaseController.h +++ b/Parse/Internal/Purchase/Controller/PFPurchaseController.h @@ -16,7 +16,7 @@ PF_OSX_UNAVAILABLE_WARNING PF_WATCH_UNAVAILABLE_WARNING -@class BFTask PF_GENERIC(__covariant BFGenericType); +@class BFTask<__covariant BFGenericType>; @class PFFileManager; @class PFPaymentTransactionObserver; @class PFProductsRequestResult; diff --git a/Parse/Internal/Push/ChannelsController/PFPushChannelsController.h b/Parse/Internal/Push/ChannelsController/PFPushChannelsController.h index faeb59ad3..2f89ec8d9 100644 --- a/Parse/Internal/Push/ChannelsController/PFPushChannelsController.h +++ b/Parse/Internal/Push/ChannelsController/PFPushChannelsController.h @@ -16,7 +16,7 @@ PF_TV_UNAVAILABLE_WARNING PF_WATCH_UNAVAILABLE_WARNING -@class BFTask PF_GENERIC(__covariant BFGenericType); +@class BFTask<__covariant BFGenericType>; NS_ASSUME_NONNULL_BEGIN @@ -36,7 +36,7 @@ PF_TV_UNAVAILABLE PF_WATCH_UNAVAILABLE @interface PFPushChannelsController : NSO /// @name Get ///-------------------------------------- -- (BFTask PF_GENERIC(NSSet *)*)getSubscribedChannelsAsync; +- (BFTask *>*)getSubscribedChannelsAsync; ///-------------------------------------- /// @name Subscribe diff --git a/Parse/Internal/Push/ChannelsController/PFPushChannelsController.m b/Parse/Internal/Push/ChannelsController/PFPushChannelsController.m index acd267dc5..88e7ff8bf 100644 --- a/Parse/Internal/Push/ChannelsController/PFPushChannelsController.m +++ b/Parse/Internal/Push/ChannelsController/PFPushChannelsController.m @@ -49,7 +49,7 @@ + (instancetype)controllerWithDataSource:(nonnull id *)*)getSubscribedChannelsAsync { +- (BFTask *>*)getSubscribedChannelsAsync { return [[self _getCurrentObjectAsync] continueWithSuccessBlock:^id(BFTask *task) { PFInstallation *installation = task.result; diff --git a/Parse/Internal/Push/Controller/PFPushController.h b/Parse/Internal/Push/Controller/PFPushController.h index f59e5b2bb..407bea865 100644 --- a/Parse/Internal/Push/Controller/PFPushController.h +++ b/Parse/Internal/Push/Controller/PFPushController.h @@ -14,7 +14,7 @@ PF_TV_UNAVAILABLE_WARNING PF_WATCH_UNAVAILABLE_WARNING -@class BFTask PF_GENERIC(__covariant BFGenericType); +@class BFTask<__covariant BFGenericType>; @class PFPushState; @protocol PFCommandRunning; diff --git a/Parse/Internal/Query/Controller/PFQueryController.h b/Parse/Internal/Query/Controller/PFQueryController.h index 6df248c36..3af416f9d 100644 --- a/Parse/Internal/Query/Controller/PFQueryController.h +++ b/Parse/Internal/Query/Controller/PFQueryController.h @@ -15,7 +15,7 @@ @class BFCancellationToken; -@class BFTask PF_GENERIC(__covariant BFGenericType); +@class BFTask<__covariant BFGenericType>; @class PFQueryState; @class PFRESTCommand; @class PFCommandResult; diff --git a/Parse/Internal/Query/PFQueryPrivate.h b/Parse/Internal/Query/PFQueryPrivate.h index 4c90e39cb..f9c51773c 100644 --- a/Parse/Internal/Query/PFQueryPrivate.h +++ b/Parse/Internal/Query/PFQueryPrivate.h @@ -39,7 +39,7 @@ extern NSString *const PFQueryOptionKeyMaxDistance; extern NSString *const PFQueryOptionKeyBox; extern NSString *const PFQueryOptionKeyRegexOptions; -@class BFTask PF_GENERIC(__covariant BFGenericType); +@class BFTask<__covariant BFGenericType>; @class PFObject; @interface PFQuery (Private) diff --git a/Parse/Internal/Session/Controller/PFSessionController.h b/Parse/Internal/Session/Controller/PFSessionController.h index 83d06e464..70ce7c1e6 100644 --- a/Parse/Internal/Session/Controller/PFSessionController.h +++ b/Parse/Internal/Session/Controller/PFSessionController.h @@ -13,7 +13,7 @@ #import "PFDataProvider.h" -@class BFTask PF_GENERIC(__covariant BFGenericType); +@class BFTask<__covariant BFGenericType>; @class PFSession; NS_ASSUME_NONNULL_BEGIN diff --git a/Parse/Internal/User/AuthenticationProviders/Controller/PFUserAuthenticationController.h b/Parse/Internal/User/AuthenticationProviders/Controller/PFUserAuthenticationController.h index 2af6966db..9e42280d4 100644 --- a/Parse/Internal/User/AuthenticationProviders/Controller/PFUserAuthenticationController.h +++ b/Parse/Internal/User/AuthenticationProviders/Controller/PFUserAuthenticationController.h @@ -16,7 +16,7 @@ NS_ASSUME_NONNULL_BEGIN -@class BFTask PF_GENERIC(__covariant BFGenericType); +@class BFTask<__covariant BFGenericType>; @class PFUser; @interface PFUserAuthenticationController : NSObject @@ -45,16 +45,16 @@ NS_ASSUME_NONNULL_BEGIN /// @name Authentication ///-------------------------------------- -- (BFTask PF_GENERIC(NSNumber *)*)restoreAuthenticationAsyncWithAuthData:(nullable NSDictionary PF_GENERIC(NSString *, NSString *)*)authData - forAuthType:(NSString *)authType; -- (BFTask PF_GENERIC(NSNumber *)*)deauthenticateAsyncWithAuthType:(NSString *)authType; +- (BFTask *)restoreAuthenticationAsyncWithAuthData:(nullable NSDictionary *)authData + forAuthType:(NSString *)authType; +- (BFTask *)deauthenticateAsyncWithAuthType:(NSString *)authType; ///-------------------------------------- /// @name Log In ///-------------------------------------- -- (BFTask PF_GENERIC(PFUser *)*)logInUserAsyncWithAuthType:(NSString *)authType - authData:(NSDictionary PF_GENERIC(NSString *, NSString *)*)authData; +- (BFTask *)logInUserAsyncWithAuthType:(NSString *)authType + authData:(NSDictionary *)authData; @end diff --git a/Parse/Internal/User/AuthenticationProviders/Controller/PFUserAuthenticationController.m b/Parse/Internal/User/AuthenticationProviders/Controller/PFUserAuthenticationController.m index 1d497af54..2936d5fc1 100644 --- a/Parse/Internal/User/AuthenticationProviders/Controller/PFUserAuthenticationController.m +++ b/Parse/Internal/User/AuthenticationProviders/Controller/PFUserAuthenticationController.m @@ -21,7 +21,7 @@ @interface PFUserAuthenticationController () { dispatch_queue_t _dataAccessQueue; - NSMutableDictionary PF_GENERIC(NSString *, id)*_authenticationDelegates; + NSMutableDictionary>*_authenticationDelegates; } @end @@ -94,8 +94,8 @@ - (void)unregisterAuthenticationDelegateForAuthType:(NSString *)authType { #pragma mark - Authentication ///-------------------------------------- -- (BFTask PF_GENERIC(NSNumber *)*)restoreAuthenticationAsyncWithAuthData:(nullable NSDictionary PF_GENERIC(NSString *, NSString *)*)authData - forAuthType:(NSString *)authType { +- (BFTask *)restoreAuthenticationAsyncWithAuthData:(nullable NSDictionary *)authData + forAuthType:(NSString *)authType { id provider = [self authenticationDelegateForAuthType:authType]; if (!provider) { return [BFTask taskWithResult:@YES]; @@ -105,7 +105,7 @@ - (void)unregisterAuthenticationDelegateForAuthType:(NSString *)authType { }]; } -- (BFTask PF_GENERIC(NSNumber *)*)deauthenticateAsyncWithAuthType:(NSString *)authType { +- (BFTask *)deauthenticateAsyncWithAuthType:(NSString *)authType { return [self restoreAuthenticationAsyncWithAuthData:nil forAuthType:authType]; } @@ -113,9 +113,9 @@ - (void)unregisterAuthenticationDelegateForAuthType:(NSString *)authType { #pragma mark - Log In ///-------------------------------------- -- (BFTask PF_GENERIC(PFUser *)*)logInUserAsyncWithAuthType:(NSString *)authType - authData:(NSDictionary PF_GENERIC(NSString *, NSString *)*)authData { - return [[self.dataSource.currentUserController getCurrentUserAsyncWithOptions:0] continueWithSuccessBlock:^id(BFTask PF_GENERIC(PFUser *)*task) { +- (BFTask *)logInUserAsyncWithAuthType:(NSString *)authType + authData:(NSDictionary *)authData { + return [[self.dataSource.currentUserController getCurrentUserAsyncWithOptions:0] continueWithSuccessBlock:^id(BFTask *task) { PFUser *currentUser = task.result; if (currentUser && [PFAnonymousUtils isLinkedWithUser:currentUser]) { if (currentUser.isLazy) { diff --git a/Parse/Internal/User/CurrentUserController/PFCurrentUserController.h b/Parse/Internal/User/CurrentUserController/PFCurrentUserController.h index 9b7c5eee9..04e12430e 100644 --- a/Parse/Internal/User/CurrentUserController/PFCurrentUserController.h +++ b/Parse/Internal/User/CurrentUserController/PFCurrentUserController.h @@ -16,7 +16,7 @@ #import "PFDataProvider.h" #import "PFMacros.h" -@class BFTask PF_GENERIC(__covariant BFGenericType); +@class BFTask<__covariant BFGenericType>; @class PFUser; typedef NS_OPTIONS(NSUInteger, PFCurrentUserLoadingOptions) { diff --git a/Parse/Internal/User/PFUserPrivate.h b/Parse/Internal/User/PFUserPrivate.h index 4dfebd46a..0b5d1b28d 100644 --- a/Parse/Internal/User/PFUserPrivate.h +++ b/Parse/Internal/User/PFUserPrivate.h @@ -17,7 +17,7 @@ extern NSString *const PFUserCurrentUserFileName; extern NSString *const PFUserCurrentUserPinName; extern NSString *const PFUserCurrentUserKeychainItemName; -@class BFTask PF_GENERIC(__covariant BFGenericType); +@class BFTask<__covariant BFGenericType>; @class PFCommandResult; @class PFUserController; diff --git a/Parse/PFAnalytics.h b/Parse/PFAnalytics.h index 958d8e42d..c5799f85e 100644 --- a/Parse/PFAnalytics.h +++ b/Parse/PFAnalytics.h @@ -41,7 +41,7 @@ NS_ASSUME_NONNULL_BEGIN @return Returns the task encapsulating the work being done. */ -+ (BFTask PF_GENERIC(NSNumber *)*)trackAppOpenedWithLaunchOptions:(nullable NSDictionary *)launchOptions; ++ (BFTask *)trackAppOpenedWithLaunchOptions:(nullable NSDictionary *)launchOptions; /** Tracks this application being launched. @@ -71,7 +71,7 @@ NS_ASSUME_NONNULL_BEGIN @return Returns the task encapsulating the work being done. */ -+ (BFTask PF_GENERIC(NSNumber *)*)trackAppOpenedWithRemoteNotificationPayload:(nullable NSDictionary *)userInfo; ++ (BFTask *)trackAppOpenedWithRemoteNotificationPayload:(nullable NSDictionary *)userInfo; /** Tracks this application being launched. If this happened as the result of the @@ -100,7 +100,7 @@ NS_ASSUME_NONNULL_BEGIN @return Returns the task encapsulating the work being done. */ -+ (BFTask PF_GENERIC(NSNumber *)*)trackEvent:(NSString *)name; ++ (BFTask *)trackEvent:(NSString *)name; /** Tracks the occurrence of a custom event. Parse will store a data point at the @@ -134,8 +134,8 @@ NS_ASSUME_NONNULL_BEGIN @return Returns the task encapsulating the work being done. */ -+ (BFTask PF_GENERIC(NSNumber *)*)trackEvent:(NSString *)name - dimensions:(nullable NSDictionary PF_GENERIC(NSString *, NSString *)*)dimensions; ++ (BFTask *)trackEvent:(NSString *)name + dimensions:(nullable NSDictionary *)dimensions; /** Tracks the occurrence of a custom event with additional dimensions. Parse will @@ -159,7 +159,7 @@ NS_ASSUME_NONNULL_BEGIN It should have the following argument signature: `^(BOOL succeeded, NSError *error)` */ + (void)trackEventInBackground:(NSString *)name - dimensions:(nullable NSDictionary PF_GENERIC(NSString *, NSString *)*)dimensions + dimensions:(nullable NSDictionary *)dimensions block:(nullable PFBooleanResultBlock)block; @end diff --git a/Parse/PFAnalytics.m b/Parse/PFAnalytics.m index 3f7429184..314f2633a 100644 --- a/Parse/PFAnalytics.m +++ b/Parse/PFAnalytics.m @@ -28,7 +28,7 @@ @implementation PFAnalytics #pragma mark - App-Open / Push Analytics ///-------------------------------------- -+ (BFTask PF_GENERIC(NSNumber *)*)trackAppOpenedWithLaunchOptions:(nullable NSDictionary *)launchOptions { ++ (BFTask *)trackAppOpenedWithLaunchOptions:(nullable NSDictionary *)launchOptions { #if TARGET_OS_WATCH || TARGET_OS_TV NSDictionary *userInfo = nil; #elif TARGET_OS_IOS @@ -45,7 +45,7 @@ + (void)trackAppOpenedWithLaunchOptionsInBackground:(nullable NSDictionary *)lau [[self trackAppOpenedWithLaunchOptions:launchOptions] thenCallBackOnMainThreadWithBoolValueAsync:block]; } -+ (BFTask PF_GENERIC(NSNumber *)*)trackAppOpenedWithRemoteNotificationPayload:(nullable NSDictionary *)userInfo { ++ (BFTask *)trackAppOpenedWithRemoteNotificationPayload:(nullable NSDictionary *)userInfo { return [[[PFUser _getCurrentUserSessionTokenAsync] continueWithBlock:^id(BFTask *task) { NSString *sessionToken = task.result; PFAnalyticsController *controller = [Parse _currentManager].analyticsController; @@ -62,7 +62,7 @@ + (void)trackAppOpenedWithRemoteNotificationPayloadInBackground:(nullable NSDict #pragma mark - Custom Analytics ///-------------------------------------- -+ (BFTask PF_GENERIC(NSNumber *)*)trackEvent:(NSString *)name { ++ (BFTask *)trackEvent:(NSString *)name { return [self trackEvent:name dimensions:nil]; } @@ -70,8 +70,8 @@ + (void)trackEventInBackground:(NSString *)name block:(nullable PFBooleanResultB [self trackEventInBackground:name dimensions:nil block:block]; } -+ (BFTask PF_GENERIC(NSNumber *)*)trackEvent:(NSString *)name - dimensions:(nullable NSDictionary PF_GENERIC(NSString *, NSString *) *)dimensions { ++ (BFTask *)trackEvent:(NSString *)name + dimensions:(nullable NSDictionary *)dimensions { PFParameterAssert([[name stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] length], @"A name for the custom event must be provided."); [dimensions enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { @@ -87,7 +87,7 @@ + (void)trackEventInBackground:(NSString *)name block:(nullable PFBooleanResultB } + (void)trackEventInBackground:(NSString *)name - dimensions:(nullable NSDictionary PF_GENERIC(NSString *, NSString *) *)dimensions + dimensions:(nullable NSDictionary *)dimensions block:(nullable PFBooleanResultBlock)block { [[self trackEvent:name dimensions:dimensions] thenCallBackOnMainThreadWithBoolValueAsync:block]; } diff --git a/Parse/PFAnonymousUtils.h b/Parse/PFAnonymousUtils.h index f1c0dba7b..888a50e4d 100644 --- a/Parse/PFAnonymousUtils.h +++ b/Parse/PFAnonymousUtils.h @@ -45,7 +45,7 @@ NS_ASSUME_NONNULL_BEGIN @return The task, that encapsulates the work being done. */ -+ (BFTask PF_GENERIC(PFUser *)*)logInInBackground; ++ (BFTask *)logInInBackground; /** Creates an anonymous user asynchronously and performs a provided block. diff --git a/Parse/PFCloud.h b/Parse/PFCloud.h index 1174b1c5a..8486b0450 100644 --- a/Parse/PFCloud.h +++ b/Parse/PFCloud.h @@ -28,8 +28,8 @@ NS_ASSUME_NONNULL_BEGIN @return The task, that encapsulates the work being done. */ -+ (BFTask PF_GENERIC(id) *)callFunctionInBackground:(NSString *)function - withParameters:(nullable NSDictionary *)parameters; ++ (BFTask *)callFunctionInBackground:(NSString *)function + withParameters:(nullable NSDictionary *)parameters; /** Calls the given cloud function *asynchronously* with the parameters provided diff --git a/Parse/PFConfig.h b/Parse/PFConfig.h index 2aca52a57..6a04350c0 100644 --- a/Parse/PFConfig.h +++ b/Parse/PFConfig.h @@ -47,7 +47,7 @@ typedef void(^PFConfigResultBlock)(PFConfig *__nullable config, NSError *__nulla @return The task, that encapsulates the work being done. */ -+ (BFTask PF_GENERIC(PFConfig *)*)getConfigInBackground; ++ (BFTask *)getConfigInBackground; /** Gets the `PFConfig` *asynchronously* and executes the given callback block. diff --git a/Parse/PFConstants.h b/Parse/PFConstants.h index fef57f367..ec5f363c4 100644 --- a/Parse/PFConstants.h +++ b/Parse/PFConstants.h @@ -453,17 +453,6 @@ extern NSString *const __nonnull PFNetworkNotificationURLResponseBodyUserInfoKey # endif #endif -///-------------------------------------- -/// @name Obj-C Generics Macros -///-------------------------------------- - -#if __has_feature(objc_generics) || __has_extension(objc_generics) -# define PF_GENERIC(...) <__VA_ARGS__> -#else -# define PF_GENERIC(...) -# define PFGenericObject PFObject * -#endif - ///-------------------------------------- /// @name Platform Availability Defines ///-------------------------------------- diff --git a/Parse/PFFile.h b/Parse/PFFile.h index 9270a7bec..31d5dd812 100644 --- a/Parse/PFFile.h +++ b/Parse/PFFile.h @@ -156,7 +156,7 @@ NS_ASSUME_NONNULL_BEGIN @return The task, that encapsulates the work being done. */ -- (BFTask PF_GENERIC(NSNumber *)*)saveInBackground; +- (BFTask *)saveInBackground; /** Saves the file *asynchronously* @@ -165,7 +165,7 @@ NS_ASSUME_NONNULL_BEGIN @return The task, that encapsulates the work being done. */ -- (BFTask PF_GENERIC(NSNumber *)*)saveInBackgroundWithProgressBlock:(nullable PFProgressBlock)progressBlock; +- (BFTask *)saveInBackgroundWithProgressBlock:(nullable PFProgressBlock)progressBlock; /** Saves the file *asynchronously* and executes the given block. @@ -195,7 +195,6 @@ NS_ASSUME_NONNULL_BEGIN */ @property (nonatomic, assign, readonly, getter=isDataAvailable) BOOL dataAvailable; - /** This method is like `-getData` but it fetches asynchronously to avoid blocking the current thread. @@ -203,7 +202,7 @@ NS_ASSUME_NONNULL_BEGIN @return The task, that encapsulates the work being done. */ -- (BFTask PF_GENERIC(NSData *)*)getDataInBackground; +- (BFTask *)getDataInBackground; /** This method is like `-getData` but it fetches asynchronously to avoid blocking the current thread. @@ -216,7 +215,7 @@ NS_ASSUME_NONNULL_BEGIN @return The task, that encapsulates the work being done. */ -- (BFTask PF_GENERIC(NSData *)*)getDataInBackgroundWithProgressBlock:(nullable PFProgressBlock)progressBlock; +- (BFTask *)getDataInBackgroundWithProgressBlock:(nullable PFProgressBlock)progressBlock; /** This method is like `-getDataInBackground` but avoids ever holding the entire `PFFile` contents in memory at once. @@ -225,7 +224,7 @@ NS_ASSUME_NONNULL_BEGIN @return The task, that encapsulates the work being done. */ -- (BFTask PF_GENERIC(NSInputStream *)*)getDataStreamInBackground; +- (BFTask *)getDataStreamInBackground; /** This method is like `-getDataStreamInBackground`, but yields a live-updating stream. @@ -240,7 +239,7 @@ NS_ASSUME_NONNULL_BEGIN @return A task that produces a *live* stream that is being written to with the data from the server. */ -- (BFTask PF_GENERIC(NSInputStream *)*)getDataDownloadStreamInBackground; +- (BFTask *)getDataDownloadStreamInBackground; /** This method is like `-getDataInBackground` but avoids @@ -251,7 +250,7 @@ NS_ASSUME_NONNULL_BEGIN @return The task, that encapsulates the work being done. */ -- (BFTask PF_GENERIC(NSInputStream *)*)getDataStreamInBackgroundWithProgressBlock:(nullable PFProgressBlock)progressBlock; +- (BFTask *)getDataStreamInBackgroundWithProgressBlock:(nullable PFProgressBlock)progressBlock; /** This method is like `-getDataStreamInBackgroundWithProgressBlock:`, but yields a live-updating stream. @@ -268,7 +267,7 @@ NS_ASSUME_NONNULL_BEGIN @return A task that produces a *live* stream that is being written to with the data from the server. */ -- (BFTask PF_GENERIC(NSInputStream *)*)getDataDownloadStreamInBackgroundWithProgressBlock:(nullable PFProgressBlock)progressBlock; +- (BFTask *)getDataDownloadStreamInBackgroundWithProgressBlock:(nullable PFProgressBlock)progressBlock; /** *Asynchronously* gets the data from cache if available or fetches its contents from the network. @@ -319,7 +318,7 @@ NS_ASSUME_NONNULL_BEGIN @return The task, with the result set to `NSString` representation of a file path. */ -- (BFTask PF_GENERIC(NSString *)*)getFilePathInBackground; +- (BFTask *)getFilePathInBackground; /** *Asynchronously* gets the file path for file from cache if available or fetches its contents from the network. @@ -332,7 +331,7 @@ NS_ASSUME_NONNULL_BEGIN @return The task, with the result set to `NSString` representation of a file path. */ -- (BFTask PF_GENERIC(NSString *)*)getFilePathInBackgroundWithProgressBlock:(nullable PFProgressBlock)progressBlock; +- (BFTask *)getFilePathInBackgroundWithProgressBlock:(nullable PFProgressBlock)progressBlock; /** *Asynchronously* gets the file path for file from cache if available or fetches its contents from the network. diff --git a/Parse/PFFile.m b/Parse/PFFile.m index 535ce8c1d..cef66128d 100644 --- a/Parse/PFFile.m +++ b/Parse/PFFile.m @@ -212,11 +212,11 @@ - (void)getDataStreamInBackgroundWithBlock:(PFDataStreamResultBlock)resultBlock [[self _getDataStreamAsyncWithProgressBlock:progressBlock] thenCallBackOnMainThreadAsync:resultBlock]; } -- (BFTask PF_GENERIC(NSString *)*)getFilePathInBackground { +- (BFTask *)getFilePathInBackground { return [self getFilePathInBackgroundWithProgressBlock:nil]; } -- (BFTask PF_GENERIC(NSString *)*)getFilePathInBackgroundWithProgressBlock:(PFProgressBlock)progressBlock { +- (BFTask *)getFilePathInBackgroundWithProgressBlock:(PFProgressBlock)progressBlock { return [[self _downloadAsyncWithProgressBlock:progressBlock] continueWithSuccessBlock:^id(BFTask *task) { if (self.dirty) { return self.stagedFilePath; diff --git a/Parse/PFInstallation.h b/Parse/PFInstallation.h index 7a8e9f7df..93cbd5863 100644 --- a/Parse/PFInstallation.h +++ b/Parse/PFInstallation.h @@ -84,7 +84,7 @@ PF_TV_UNAVAILABLE PF_WATCH_UNAVAILABLE @interface PFInstallation : PFObject *channels; /** Sets the device token string property from an `NSData`-encoded token. diff --git a/Parse/PFInstallation.m b/Parse/PFInstallation.m index 29634a357..d069fd6b3 100644 --- a/Parse/PFInstallation.m +++ b/Parse/PFInstallation.m @@ -52,8 +52,8 @@ - (void)_clearDeviceToken { [super removeObjectForKey:PFInstallationKeyDeviceToken]; } -- (BFTask PF_GENERIC(PFVoid) *)_validateDeleteAsync { - return [[super _validateDeleteAsync] continueWithSuccessBlock:^id(BFTask PF_GENERIC(PFVoid) *task) { +- (BFTask *)_validateDeleteAsync { + return [[super _validateDeleteAsync] continueWithSuccessBlock:^id(BFTask *task) { NSError *error = [PFErrorUtilities errorWithCode:kPFErrorCommandUnavailable message:@"Installation cannot be deleted"]; return [BFTask taskWithError:error]; @@ -210,7 +210,7 @@ - (void)setLocaleIdentifier:(NSString *)localeIdentifier { onlyIfDifferent:YES]; } -- (void)setChannels:(NSArray PF_GENERIC(NSString *)*)channels { +- (void)setChannels:(NSArray *)channels { [self _setObject:channels forKey:PFInstallationKeyChannels onlyIfDifferent:YES]; } diff --git a/Parse/PFObject+Deprecated.h b/Parse/PFObject+Deprecated.h index 16ffc0d43..dead1701c 100644 --- a/Parse/PFObject+Deprecated.h +++ b/Parse/PFObject+Deprecated.h @@ -49,7 +49,7 @@ @deprecated Please use `PFObject.+saveAllInBackground:block:` instead. */ -+ (void)saveAllInBackground:(nullable NSArray PF_GENERIC(PFObject *)*)objects ++ (void)saveAllInBackground:(nullable NSArray *)objects target:(nullable id)target selector:(nullable SEL)selector PARSE_DEPRECATED("Please use `PFObject.+saveAllInBackground:block:` instead."); @@ -116,7 +116,7 @@ @deprecated Please use `PFObject.+fetchAllInBackground:block:` instead. */ -+ (void)fetchAllInBackground:(nullable NSArray PF_GENERIC(PFObject *)*)objects ++ (void)fetchAllInBackground:(nullable NSArray *)objects target:(nullable id)target selector:(nullable SEL)selector PARSE_DEPRECATED("Please use `PFObject.+fetchAllInBackground:block:` instead."); @@ -133,7 +133,7 @@ @deprecated Please use `PFObject.+fetchAllIfNeededInBackground:block:` instead. */ -+ (void)fetchAllIfNeededInBackground:(nullable NSArray PF_GENERIC(PFObject *)*)objects ++ (void)fetchAllIfNeededInBackground:(nullable NSArray *)objects target:(nullable id)target selector:(nullable SEL)selector PARSE_DEPRECATED("Please use `PFObject.+fetchAllIfNeededInBackground:block:` instead."); @@ -171,7 +171,7 @@ @deprecated Please use `PFObject.+deleteAllInBackground:block:` instead. */ -+ (void)deleteAllInBackground:(nullable NSArray PF_GENERIC(PFObject *)*)objects ++ (void)deleteAllInBackground:(nullable NSArray *)objects target:(nullable id)target selector:(nullable SEL)selector PARSE_DEPRECATED("Please use `PFObject.+deleteAllInBackground:block:` instead."); diff --git a/Parse/PFObject+Subclass.h b/Parse/PFObject+Subclass.h index a5106e548..c30dae642 100644 --- a/Parse/PFObject+Subclass.h +++ b/Parse/PFObject+Subclass.h @@ -11,7 +11,7 @@ #import -@class PFQuery PF_GENERIC(PFGenericObject : PFObject *); +@class PFQuery; NS_ASSUME_NONNULL_BEGIN diff --git a/Parse/PFObject+Synchronous.h b/Parse/PFObject+Synchronous.h index 873ac9122..4f7ddc6e2 100644 --- a/Parse/PFObject+Synchronous.h +++ b/Parse/PFObject+Synchronous.h @@ -50,7 +50,7 @@ NS_ASSUME_NONNULL_BEGIN @return Returns whether the save succeeded. */ -+ (BOOL)saveAll:(nullable NSArray PF_GENERIC(PFObject *)*)objects PF_SWIFT_UNAVAILABLE; ++ (BOOL)saveAll:(nullable NSArray *)objects PF_SWIFT_UNAVAILABLE; /** Saves a collection of objects *synchronously* all at once and sets an error if necessary. @@ -60,7 +60,7 @@ NS_ASSUME_NONNULL_BEGIN @return Returns whether the save succeeded. */ -+ (BOOL)saveAll:(nullable NSArray PF_GENERIC(PFObject *)*)objects error:(NSError **)error; ++ (BOOL)saveAll:(nullable NSArray *)objects error:(NSError **)error; ///-------------------------------------- /// @name Getting an Object @@ -98,7 +98,7 @@ NS_ASSUME_NONNULL_BEGIN @param objects The list of objects to fetch. */ -+ (nullable NSArray PF_GENERIC(__kindof PFObject *)*)fetchAll:(nullable NSArray PF_GENERIC(PFObject *)*)objects PF_SWIFT_UNAVAILABLE; ++ (nullable NSArray<__kindof PFObject *> *)fetchAll:(nullable NSArray *)objects PF_SWIFT_UNAVAILABLE; /** *Synchronously* fetches all of the `PFObject` objects with the current data from the server @@ -107,14 +107,14 @@ NS_ASSUME_NONNULL_BEGIN @param objects The list of objects to fetch. @param error Pointer to an `NSError` that will be set if necessary. */ -+ (nullable NSArray PF_GENERIC(__kindof PFObject *)*)fetchAll:(nullable NSArray PF_GENERIC(PFObject *)*)objects - error:(NSError **)error; ++ (nullable NSArray<__kindof PFObject *> *)fetchAll:(nullable NSArray *)objects + error:(NSError **)error; /** *Synchronously* fetches all of the `PFObject` objects with the current data from the server. @param objects The list of objects to fetch. */ -+ (nullable NSArray PF_GENERIC(__kindof PFObject *)*)fetchAllIfNeeded:(nullable NSArray PF_GENERIC(PFObject *)*)objects PF_SWIFT_UNAVAILABLE; ++ (nullable NSArray<__kindof PFObject *> *)fetchAllIfNeeded:(nullable NSArray *)objects PF_SWIFT_UNAVAILABLE; /** *Synchronously* fetches all of the `PFObject` objects with the current data from the server @@ -123,8 +123,8 @@ NS_ASSUME_NONNULL_BEGIN @param objects The list of objects to fetch. @param error Pointer to an `NSError` that will be set if necessary. */ -+ (nullable NSArray PF_GENERIC(__kindof PFObject *)*)fetchAllIfNeeded:(nullable NSArray PF_GENERIC(PFObject *)*)objects - error:(NSError **)error; ++ (nullable NSArray<__kindof PFObject *> *)fetchAllIfNeeded:(nullable NSArray *)objects + error:(NSError **)error; ///-------------------------------------- /// @name Fetching From Local Datastore @@ -178,7 +178,7 @@ NS_ASSUME_NONNULL_BEGIN @return Returns whether the delete succeeded. */ -+ (BOOL)deleteAll:(nullable NSArray PF_GENERIC(PFObject *)*)objects PF_SWIFT_UNAVAILABLE; ++ (BOOL)deleteAll:(nullable NSArray *)objects PF_SWIFT_UNAVAILABLE; /** *Synchronously* deletes a collection of objects all at once and sets an error if necessary. @@ -188,7 +188,7 @@ NS_ASSUME_NONNULL_BEGIN @return Returns whether the delete succeeded. */ -+ (BOOL)deleteAll:(nullable NSArray PF_GENERIC(PFObject *)*)objects error:(NSError **)error; ++ (BOOL)deleteAll:(nullable NSArray *)objects error:(NSError **)error; ///-------------------------------------- /// @name Pinning @@ -281,7 +281,7 @@ NS_ASSUME_NONNULL_BEGIN @see unpinAll: @see PFObjectDefaultPin */ -+ (BOOL)pinAll:(nullable NSArray PF_GENERIC(PFObject *)*)objects PF_SWIFT_UNAVAILABLE; ++ (BOOL)pinAll:(nullable NSArray *)objects PF_SWIFT_UNAVAILABLE; /** *Synchronously* stores the objects and every object they point to in the local datastore, recursively, @@ -300,7 +300,7 @@ NS_ASSUME_NONNULL_BEGIN @see unpinAll:error: @see PFObjectDefaultPin */ -+ (BOOL)pinAll:(nullable NSArray PF_GENERIC(PFObject *)*)objects error:(NSError **)error; ++ (BOOL)pinAll:(nullable NSArray *)objects error:(NSError **)error; /** *Synchronously* stores the objects and every object they point to in the local datastore, recursively. @@ -317,7 +317,7 @@ NS_ASSUME_NONNULL_BEGIN @see unpinAll:withName: */ -+ (BOOL)pinAll:(nullable NSArray PF_GENERIC(PFObject *)*)objects withName:(NSString *)name PF_SWIFT_UNAVAILABLE; ++ (BOOL)pinAll:(nullable NSArray *)objects withName:(NSString *)name PF_SWIFT_UNAVAILABLE; /** *Synchronously* stores the objects and every object they point to in the local datastore, recursively. @@ -335,7 +335,7 @@ NS_ASSUME_NONNULL_BEGIN @see unpinAll:withName:error: */ -+ (BOOL)pinAll:(nullable NSArray PF_GENERIC(PFObject *)*)objects withName:(NSString *)name error:(NSError **)error; ++ (BOOL)pinAll:(nullable NSArray *)objects withName:(NSString *)name error:(NSError **)error; ///-------------------------------------- /// @name Unpinning @@ -444,7 +444,7 @@ NS_ASSUME_NONNULL_BEGIN @see pinAll: @see PFObjectDefaultPin */ -+ (BOOL)unpinAll:(nullable NSArray PF_GENERIC(PFObject *)*)objects PF_SWIFT_UNAVAILABLE; ++ (BOOL)unpinAll:(nullable NSArray *)objects PF_SWIFT_UNAVAILABLE; /** *Synchronously* removes the objects and every object they point to in the local datastore, recursively, @@ -458,7 +458,7 @@ NS_ASSUME_NONNULL_BEGIN @see pinAll:error: @see PFObjectDefaultPin */ -+ (BOOL)unpinAll:(nullable NSArray PF_GENERIC(PFObject *)*)objects error:(NSError **)error; ++ (BOOL)unpinAll:(nullable NSArray *)objects error:(NSError **)error; /** *Synchronously* removes the objects and every object they point to in the local datastore, recursively. @@ -470,7 +470,7 @@ NS_ASSUME_NONNULL_BEGIN @see pinAll:withName: */ -+ (BOOL)unpinAll:(nullable NSArray PF_GENERIC(PFObject *)*)objects withName:(NSString *)name PF_SWIFT_UNAVAILABLE; ++ (BOOL)unpinAll:(nullable NSArray *)objects withName:(NSString *)name PF_SWIFT_UNAVAILABLE; /** *Synchronously* removes the objects and every object they point to in the local datastore, recursively. @@ -483,7 +483,7 @@ NS_ASSUME_NONNULL_BEGIN @see pinAll:withName:error: */ -+ (BOOL)unpinAll:(nullable NSArray PF_GENERIC(PFObject *)*)objects withName:(NSString *)name error:(NSError **)error; ++ (BOOL)unpinAll:(nullable NSArray *)objects withName:(NSString *)name error:(NSError **)error; @end diff --git a/Parse/PFObject.h b/Parse/PFObject.h index af539bfa7..962f7dd50 100644 --- a/Parse/PFObject.h +++ b/Parse/PFObject.h @@ -64,7 +64,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS @return A PFObject with the given class name and set with the given data. */ -+ (instancetype)objectWithClassName:(NSString *)className dictionary:(nullable NSDictionary PF_GENERIC(NSString *, id)*)dictionary; ++ (instancetype)objectWithClassName:(NSString *)className dictionary:(nullable NSDictionary *)dictionary; /** Creates a reference to an existing PFObject for use in creating associations between PFObjects. @@ -114,7 +114,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS This does not include `createdAt`, `updatedAt`, `authData`, or `objectId`. It does include things like username and ACL. */ -@property (nonatomic, copy, readonly) NSArray PF_GENERIC(NSString *)*allKeys; +@property (nonatomic, copy, readonly) NSArray *allKeys; ///-------------------------------------- /// @name Accessors @@ -291,7 +291,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS @return The task that encapsulates the work being done. */ -- (BFTask PF_GENERIC(NSNumber *)*)saveInBackground; +- (BFTask *)saveInBackground; /** Saves the `PFObject` *asynchronously* and executes the given callback block. @@ -317,7 +317,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS @return The task that encapsulates the work being done. */ -- (BFTask PF_GENERIC(NSNumber *)*)saveEventually PF_TV_UNAVAILABLE PF_WATCH_UNAVAILABLE; +- (BFTask *)saveEventually PF_TV_UNAVAILABLE PF_WATCH_UNAVAILABLE; /** Saves this object to the server at some unspecified time in the future, @@ -350,7 +350,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS @return The task that encapsulates the work being done. */ -+ (BFTask PF_GENERIC(NSNumber *)*)saveAllInBackground:(nullable NSArray PF_GENERIC(PFObject *)*)objects; ++ (BFTask *)saveAllInBackground:(nullable NSArray *)objects; /** Saves a collection of objects all at once `asynchronously` and executes the block when done. @@ -359,7 +359,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS @param block The block to execute. It should have the following argument signature: `^(BOOL succeeded, NSError *error)`. */ -+ (void)saveAllInBackground:(nullable NSArray PF_GENERIC(PFObject *)*)objects ++ (void)saveAllInBackground:(nullable NSArray *)objects block:(nullable PFBooleanResultBlock)block; ///-------------------------------------- @@ -371,7 +371,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS @param objects The array of objects to delete. @return The task that encapsulates the work being done. */ -+ (BFTask PF_GENERIC(NSNumber *)*)deleteAllInBackground:(nullable NSArray PF_GENERIC(PFObject *)*)objects; ++ (BFTask *)deleteAllInBackground:(nullable NSArray *)objects; /** Deletes a collection of objects all at once *asynchronously* and executes the block when done. @@ -380,7 +380,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS @param block The block to execute. It should have the following argument signature: `^(BOOL succeeded, NSError *error)`. */ -+ (void)deleteAllInBackground:(nullable NSArray PF_GENERIC(PFObject *)*)objects ++ (void)deleteAllInBackground:(nullable NSArray *)objects block:(nullable PFBooleanResultBlock)block; ///-------------------------------------- @@ -429,7 +429,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS @return The task that encapsulates the work being done. */ -- (BFTask PF_GENERIC(__kindof PFObject *)*)fetchInBackground; +- (BFTask<__kindof PFObject *> *)fetchInBackground; /** Fetches the `PFObject` *asynchronously* and executes the given callback block. @@ -445,7 +445,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS @return The task that encapsulates the work being done. */ -- (BFTask PF_GENERIC(__kindof PFObject *)*)fetchIfNeededInBackground; +- (BFTask<__kindof PFObject *> *)fetchIfNeededInBackground; /** Fetches the `PFObject` data *asynchronously* if `dataAvailable` is `NO`, then calls the callback block. @@ -466,7 +466,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS @return The task that encapsulates the work being done. */ -+ (BFTask PF_GENERIC(NSArray<__kindof PFObject *> *)*)fetchAllInBackground:(nullable NSArray PF_GENERIC(PFObject *)*)objects; ++ (BFTask *> *)fetchAllInBackground:(nullable NSArray *)objects; /** Fetches all of the `PFObject` objects with the current data from the server *asynchronously* @@ -476,7 +476,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS @param block The block to execute. It should have the following argument signature: `^(NSArray *objects, NSError *error)`. */ -+ (void)fetchAllInBackground:(nullable NSArray PF_GENERIC(PFObject *)*)objects ++ (void)fetchAllInBackground:(nullable NSArray *)objects block:(nullable PFArrayResultBlock)block; /** @@ -486,7 +486,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS @return The task that encapsulates the work being done. */ -+ (BFTask PF_GENERIC(NSArray<__kindof PFObject *> *)*)fetchAllIfNeededInBackground:(nullable NSArray PF_GENERIC(PFObject *)*)objects; ++ (BFTask *> *)fetchAllIfNeededInBackground:(nullable NSArray *)objects; /** Fetches all of the PFObjects with the current data from the server *asynchronously* @@ -496,7 +496,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS @param block The block to execute. It should have the following argument signature: `^(NSArray *objects, NSError *error)`. */ -+ (void)fetchAllIfNeededInBackground:(nullable NSArray PF_GENERIC(PFObject *)*)objects ++ (void)fetchAllIfNeededInBackground:(nullable NSArray *)objects block:(nullable PFArrayResultBlock)block; ///-------------------------------------- @@ -509,7 +509,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS @return The task that encapsulates the work being done. */ -- (BFTask PF_GENERIC(__kindof PFObject *)*)fetchFromLocalDatastoreInBackground; +- (BFTask<__kindof PFObject *> *)fetchFromLocalDatastoreInBackground; /** *Asynchronously* loads data from the local datastore into this object, @@ -529,7 +529,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS @return The task that encapsulates the work being done. */ -- (BFTask PF_GENERIC(NSNumber *)*)deleteInBackground; +- (BFTask *)deleteInBackground; /** Deletes the `PFObject` *asynchronously* and executes the given callback block. @@ -556,7 +556,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS @return The task that encapsulates the work being done. */ -- (BFTask PF_GENERIC(NSNumber *)*)deleteEventually PF_TV_UNAVAILABLE PF_WATCH_UNAVAILABLE; +- (BFTask *)deleteEventually PF_TV_UNAVAILABLE PF_WATCH_UNAVAILABLE; ///-------------------------------------- /// @name Dirtiness @@ -597,7 +597,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS @see `-unpinInBackground` @see `PFObjectDefaultPin` */ -- (BFTask PF_GENERIC(NSNumber *)*)pinInBackground; +- (BFTask *)pinInBackground; /** *Asynchronously* stores the object and every object it points to in the local datastore, recursively, @@ -630,7 +630,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS @see unpinInBackgroundWithName: */ -- (BFTask PF_GENERIC(NSNumber *)*)pinInBackgroundWithName:(NSString *)name; +- (BFTask *)pinInBackgroundWithName:(NSString *)name; /** *Asynchronously* stores the object and every object it points to in the local datastore, recursively. @@ -668,7 +668,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS @see unpinAllInBackground: @see PFObjectDefaultPin */ -+ (BFTask PF_GENERIC(NSNumber *)*)pinAllInBackground:(nullable NSArray PF_GENERIC(PFObject *)*)objects; ++ (BFTask *)pinAllInBackground:(nullable NSArray *)objects; /** *Asynchronously* stores the objects and every object they point to in the local datastore, recursively, @@ -686,7 +686,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS @see unpinAllInBackground:block: @see PFObjectDefaultPin */ -+ (void)pinAllInBackground:(nullable NSArray PF_GENERIC(PFObject *)*)objects block:(nullable PFBooleanResultBlock)block; ++ (void)pinAllInBackground:(nullable NSArray *)objects block:(nullable PFBooleanResultBlock)block; /** *Asynchronously* stores the objects and every object they point to in the local datastore, recursively. @@ -703,7 +703,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS @see unpinAllInBackground:withName: */ -+ (BFTask PF_GENERIC(NSNumber *)*)pinAllInBackground:(nullable NSArray PF_GENERIC(PFObject *)*)objects withName:(NSString *)name; ++ (BFTask *)pinAllInBackground:(nullable NSArray *)objects withName:(NSString *)name; /** *Asynchronously* stores the objects and every object they point to in the local datastore, recursively. @@ -720,7 +720,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS @see unpinAllInBackground:withName:block: */ -+ (void)pinAllInBackground:(nullable NSArray PF_GENERIC(PFObject *)*)objects ++ (void)pinAllInBackground:(nullable NSArray *)objects withName:(NSString *)name block:(nullable PFBooleanResultBlock)block; @@ -737,7 +737,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS @see pinInBackground @see PFObjectDefaultPin */ -- (BFTask PF_GENERIC(NSNumber *)*)unpinInBackground; +- (BFTask *)unpinInBackground; /** *Asynchronously* removes the object and every object it points to in the local datastore, recursively, @@ -760,7 +760,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS @see pinInBackgroundWithName: */ -- (BFTask PF_GENERIC(NSNumber *)*)unpinInBackgroundWithName:(NSString *)name; +- (BFTask *)unpinInBackgroundWithName:(NSString *)name; /** *Asynchronously* removes the object and every object it points to in the local datastore, recursively. @@ -785,7 +785,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS @see PFObjectDefaultPin */ -+ (BFTask PF_GENERIC(NSNumber *)*)unpinAllObjectsInBackground; ++ (BFTask *)unpinAllObjectsInBackground; /** *Asynchronously* removes all objects in the local datastore @@ -805,7 +805,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS @return The task that encapsulates the work being done. */ -+ (BFTask PF_GENERIC(NSNumber *)*)unpinAllObjectsInBackgroundWithName:(NSString *)name; ++ (BFTask *)unpinAllObjectsInBackgroundWithName:(NSString *)name; /** *Asynchronously* removes all objects with the specified pin name. @@ -827,7 +827,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS @see pinAllInBackground: @see PFObjectDefaultPin */ -+ (BFTask PF_GENERIC(NSNumber *)*)unpinAllInBackground:(nullable NSArray PF_GENERIC(PFObject *)*)objects; ++ (BFTask *)unpinAllInBackground:(nullable NSArray *)objects; /** *Asynchronously* removes the objects and every object they point to in the local datastore, recursively, @@ -840,7 +840,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS @see pinAllInBackground:block: @see PFObjectDefaultPin */ -+ (void)unpinAllInBackground:(nullable NSArray PF_GENERIC(PFObject *)*)objects block:(nullable PFBooleanResultBlock)block; ++ (void)unpinAllInBackground:(nullable NSArray *)objects block:(nullable PFBooleanResultBlock)block; /** *Asynchronously* removes the objects and every object they point to in the local datastore, recursively. @@ -852,7 +852,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS @see pinAllInBackground:withName: */ -+ (BFTask PF_GENERIC(NSNumber *)*)unpinAllInBackground:(nullable NSArray PF_GENERIC(PFObject *)*)objects withName:(NSString *)name; ++ (BFTask *)unpinAllInBackground:(nullable NSArray *)objects withName:(NSString *)name; /** *Asynchronously* removes the objects and every object they point to in the local datastore, recursively. @@ -864,7 +864,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS @see pinAllInBackground:withName:block: */ -+ (void)unpinAllInBackground:(nullable NSArray PF_GENERIC(PFObject *)*)objects ++ (void)unpinAllInBackground:(nullable NSArray *)objects withName:(NSString *)name block:(nullable PFBooleanResultBlock)block; diff --git a/Parse/PFObject.m b/Parse/PFObject.m index 38ae702e8..8c312bad5 100644 --- a/Parse/PFObject.m +++ b/Parse/PFObject.m @@ -1702,7 +1702,7 @@ + (PFObjectState *)_newObjectStateWithParseClassName:(NSString *)className #pragma mark - Validation ///-------------------------------------- -- (BFTask PF_GENERIC(PFVoid) *)_validateFetchAsync { +- (BFTask *)_validateFetchAsync { if (!self._state.objectId) { NSError *error = [PFErrorUtilities errorWithCode:kPFErrorMissingObjectId message:@"Can't fetch an object that hasn't been saved to the server."]; @@ -1711,11 +1711,11 @@ + (PFObjectState *)_newObjectStateWithParseClassName:(NSString *)className return [BFTask taskWithResult:nil]; } -- (BFTask PF_GENERIC(PFVoid) *)_validateDeleteAsync { +- (BFTask *)_validateDeleteAsync { return [BFTask taskWithResult:nil]; } -- (BFTask PF_GENERIC(PFVoid) *)_validateSaveEventuallyAsync { +- (BFTask *)_validateSaveEventuallyAsync { return [BFTask taskWithResult:nil]; } @@ -2200,7 +2200,7 @@ - (void)setValue:(id)value forUndefinedKey:(NSString *)key { self[key] = value; } -- (void)setValuesForKeysWithDictionary:(NSDictionary PF_GENERIC(NSString *,id)*)keyedValues { +- (void)setValuesForKeysWithDictionary:(NSDictionary *)keyedValues { // This is overwritten to make sure we don't use `nil` instead of `NSNull` (the default NSObject implementation). // Remove this if we 100% conform to KVC. [keyedValues enumerateKeysAndObjectsUsingBlock:^(NSString *key, id obj, BOOL *stop) { @@ -2266,10 +2266,10 @@ + (void)saveAllInBackground:(NSArray *)objects block:(PFBooleanResultBlock)block #pragma mark - Delete all ///-------------------------------------- -+ (BFTask PF_GENERIC(NSNumber *) *)deleteAllInBackground:(NSArray *)objects { ++ (BFTask *)deleteAllInBackground:(NSArray *)objects { NSArray *deleteObjects = [objects copy]; // Snapshot the objects. if (deleteObjects.count == 0) { - return [BFTask PF_GENERIC(NSNumber *) taskWithResult:@YES]; + return [BFTask taskWithResult:@YES]; } return [[[[self currentUserController] getCurrentUserSessionTokenAsync] continueWithBlock:^id(BFTask *task) { NSString *sessionToken = task.result; @@ -2277,7 +2277,7 @@ + (void)saveAllInBackground:(NSArray *)objects block:(PFBooleanResultBlock)block NSArray *uniqueObjects = [PFObjectBatchController uniqueObjectsArrayFromArray:deleteObjects usingFilter:^BOOL(PFObject *object) { return (object.objectId != nil); }]; - NSMutableArray PF_GENERIC(BFTask *) *validationTasks = [NSMutableArray array]; + NSMutableArray *> *validationTasks = [NSMutableArray array]; for (PFObject *object in uniqueObjects) { [validationTasks addObject:[object _validateDeleteAsync]]; } @@ -2342,7 +2342,7 @@ - (void)forwardInvocation:(NSInvocation *)anInvocation { #pragma mark - Pinning ///-------------------------------------- -- (BFTask PF_GENERIC(NSNumber *)*)pinInBackground { +- (BFTask *)pinInBackground { return [self pinInBackgroundWithName:PFObjectDefaultPin]; } @@ -2354,11 +2354,11 @@ - (void)pinInBackgroundWithName:(NSString *)name block:(PFBooleanResultBlock)blo [[self pinInBackgroundWithName:name] thenCallBackOnMainThreadWithBoolValueAsync:block]; } -- (BFTask PF_GENERIC(NSNumber *)*)pinInBackgroundWithName:(NSString *)name { +- (BFTask *)pinInBackgroundWithName:(NSString *)name { return [self _pinInBackgroundWithName:name includeChildren:YES]; } -- (BFTask PF_GENERIC(NSNumber *)*)_pinInBackgroundWithName:(NSString *)name includeChildren:(BOOL)includeChildren { +- (BFTask *)_pinInBackgroundWithName:(NSString *)name includeChildren:(BOOL)includeChildren { return [[self class] _pinAllInBackground:@[ self ] withName:name includeChildren:includeChildren]; } @@ -2366,7 +2366,7 @@ - (void)pinInBackgroundWithName:(NSString *)name block:(PFBooleanResultBlock)blo #pragma mark - Pinning Many Objects ///-------------------------------------- -+ (BFTask PF_GENERIC(NSNumber *)*)pinAllInBackground:(NSArray *)objects { ++ (BFTask *)pinAllInBackground:(NSArray *)objects { return [self pinAllInBackground:objects withName:PFObjectDefaultPin]; } @@ -2375,7 +2375,7 @@ + (void)pinAllInBackground:(NSArray *)objects [[self pinAllInBackground:objects] thenCallBackOnMainThreadWithBoolValueAsync:block]; } -+ (BFTask PF_GENERIC(NSNumber *)*)pinAllInBackground:(NSArray *)objects withName:(NSString *)name { ++ (BFTask *)pinAllInBackground:(NSArray *)objects withName:(NSString *)name { return [self _pinAllInBackground:objects withName:name includeChildren:YES]; } @@ -2385,7 +2385,7 @@ + (void)pinAllInBackground:(NSArray *)objects [[self pinAllInBackground:objects withName:name] thenCallBackOnMainThreadWithBoolValueAsync:block]; } -+ (BFTask PF_GENERIC(NSNumber *)*)_pinAllInBackground:(NSArray *)objects withName:(NSString *)name includeChildren:(BOOL)includeChildren { ++ (BFTask *)_pinAllInBackground:(NSArray *)objects withName:(NSString *)name includeChildren:(BOOL)includeChildren { return [[[self pinningObjectStore] pinObjectsAsync:objects withPinName:name includeChildren:includeChildren] continueWithSuccessResult:@YES]; @@ -2395,7 +2395,7 @@ + (void)pinAllInBackground:(NSArray *)objects #pragma mark - Unpinning ///-------------------------------------- -- (BFTask PF_GENERIC(NSNumber *)*)unpinInBackground { +- (BFTask *)unpinInBackground { return [self unpinInBackgroundWithName:PFObjectDefaultPin]; } @@ -2403,7 +2403,7 @@ - (void)unpinInBackgroundWithBlock:(PFBooleanResultBlock)block { [[self unpinInBackground] thenCallBackOnMainThreadWithBoolValueAsync:block]; } -- (BFTask PF_GENERIC(NSNumber *)*)unpinInBackgroundWithName:(NSString *)name { +- (BFTask *)unpinInBackgroundWithName:(NSString *)name { return [[self class] unpinAllInBackground:@[ self ] withName:name]; } @@ -2415,7 +2415,7 @@ - (void)unpinInBackgroundWithName:(NSString *)name block:(PFBooleanResultBlock)b #pragma mark - Unpinning Many Objects ///-------------------------------------- -+ (BFTask PF_GENERIC(NSNumber *)*)unpinAllObjectsInBackground { ++ (BFTask *)unpinAllObjectsInBackground { return [self unpinAllObjectsInBackgroundWithName:PFObjectDefaultPin]; } @@ -2427,7 +2427,7 @@ + (void)unpinAllObjectsInBackgroundWithName:(NSString *)name block:(PFBooleanRes [[self unpinAllObjectsInBackgroundWithName:name] thenCallBackOnMainThreadWithBoolValueAsync:block]; } -+ (BFTask PF_GENERIC(NSNumber *)*)unpinAllObjectsInBackgroundWithName:(NSString *)name { ++ (BFTask *)unpinAllObjectsInBackgroundWithName:(NSString *)name { return [[[self pinningObjectStore] unpinAllObjectsAsyncWithPinName:name] continueWithSuccessResult:@YES]; } @@ -2439,7 +2439,7 @@ + (void)unpinAllInBackground:(NSArray *)objects block:(PFBooleanResultBlock)bloc [[self unpinAllInBackground:objects] thenCallBackOnMainThreadWithBoolValueAsync:block]; } -+ (BFTask PF_GENERIC(NSNumber *)*)unpinAllInBackground:(NSArray *)objects withName:(NSString *)name { ++ (BFTask *)unpinAllInBackground:(NSArray *)objects withName:(NSString *)name { return [[[self pinningObjectStore] unpinObjectsAsync:objects withPinName:name] continueWithSuccessResult:@YES]; } @@ -2675,7 +2675,7 @@ - (void)saveInBackgroundWithTarget:(nullable id)target selector:(nullable SEL)se #pragma mark Saving Many Objects -+ (void)saveAllInBackground:(NSArray PF_GENERIC(PFObject *)*)objects target:(nullable id)target selector:(nullable SEL)selector { ++ (void)saveAllInBackground:(NSArray *)objects target:(nullable id)target selector:(nullable SEL)selector { [self saveAllInBackground:objects block:^(BOOL succeeded, NSError *error) { [PFInternalUtils safePerformSelector:selector withTarget:target object:@(succeeded) object:error]; }]; @@ -2701,13 +2701,13 @@ - (void)fetchIfNeededInBackgroundWithTarget:(nullable id)target selector:(nullab #pragma mark Getting Many Objects -+ (void)fetchAllInBackground:(NSArray PF_GENERIC(PFObject *)*)objects target:(nullable id)target selector:(nullable SEL)selector { ++ (void)fetchAllInBackground:(NSArray *)objects target:(nullable id)target selector:(nullable SEL)selector { [self fetchAllInBackground:objects block:^(NSArray *objects, NSError *error) { [PFInternalUtils safePerformSelector:selector withTarget:target object:objects object:error]; }]; } -+ (void)fetchAllIfNeededInBackground:(NSArray PF_GENERIC(PFObject *)*)objects target:(nullable id)target selector:(nullable SEL)selector { ++ (void)fetchAllIfNeededInBackground:(NSArray *)objects target:(nullable id)target selector:(nullable SEL)selector { [self fetchAllIfNeededInBackground:objects block:^(NSArray *objects, NSError *error) { [PFInternalUtils safePerformSelector:selector withTarget:target object:objects object:error]; }]; @@ -2723,7 +2723,7 @@ - (void)deleteInBackgroundWithTarget:(nullable id)target selector:(nullable SEL) #pragma mark Deleting Many Objects -+ (void)deleteAllInBackground:(NSArray PF_GENERIC(PFObject *)*)objects target:(nullable id)target selector:(nullable SEL)selector { ++ (void)deleteAllInBackground:(NSArray *)objects target:(nullable id)target selector:(nullable SEL)selector { [self deleteAllInBackground:objects block:^(BOOL succeeded, NSError *error) { [PFInternalUtils safePerformSelector:selector withTarget:target object:@(succeeded) object:error]; }]; diff --git a/Parse/PFPush+Synchronous.h b/Parse/PFPush+Synchronous.h index 712d92f7e..1ce8c558b 100644 --- a/Parse/PFPush+Synchronous.h +++ b/Parse/PFPush+Synchronous.h @@ -53,7 +53,7 @@ NS_ASSUME_NONNULL_BEGIN @return Returns whether the send succeeded. */ -+ (BOOL)sendPushMessageToQuery:(PFQuery PF_GENERIC(PFInstallation *)*)query withMessage:(NSString *)message error:(NSError **)error; ++ (BOOL)sendPushMessageToQuery:(PFQuery *)query withMessage:(NSString *)message error:(NSError **)error; /** *Synchronously* send a push message with arbitrary data to a channel. @@ -81,7 +81,7 @@ NS_ASSUME_NONNULL_BEGIN @return Returns whether the send succeeded. */ -+ (BOOL)sendPushDataToQuery:(PFQuery PF_GENERIC(PFInstallation *)*)query withData:(NSDictionary *)data error:(NSError **)error; ++ (BOOL)sendPushDataToQuery:(PFQuery *)query withData:(NSDictionary *)data error:(NSError **)error; ///-------------------------------------- /// @name Managing Channel Subscriptions @@ -94,7 +94,7 @@ NS_ASSUME_NONNULL_BEGIN @return Returns an `NSSet` containing all the channel names this device is subscribed to. */ -+ (nullable NSSet PF_GENERIC(NSString *)*)getSubscribedChannels:(NSError **)error; ++ (nullable NSSet *)getSubscribedChannels:(NSError **)error; /** *Synchrnously* subscribes the device to a channel of push notifications. diff --git a/Parse/PFPush.h b/Parse/PFPush.h index e388e7abd..0ea2550ee 100644 --- a/Parse/PFPush.h +++ b/Parse/PFPush.h @@ -17,7 +17,7 @@ PF_TV_UNAVAILABLE_WARNING PF_WATCH_UNAVAILABLE_WARNING -@class PFQuery PF_GENERIC(PFGenericObject : PFObject *); +@class PFQuery; NS_ASSUME_NONNULL_BEGIN @@ -53,7 +53,7 @@ PF_TV_UNAVAILABLE PF_WATCH_UNAVAILABLE @interface PFPush : NSObject @param channels The array of channels to set for this push. Each channel name must start with a letter and contain only letters, numbers, dashes, and underscores. */ -- (void)setChannels:(nullable NSArray PF_GENERIC(NSString *)*)channels; +- (void)setChannels:(nullable NSArray *)channels; /** Sets an installation query to which this push notification will be sent. @@ -62,7 +62,7 @@ PF_TV_UNAVAILABLE PF_WATCH_UNAVAILABLE @interface PFPush : NSObject @param query The installation query to set for this push. */ -- (void)setQuery:(nullable PFQuery PF_GENERIC(PFInstallation *)*)query; +- (void)setQuery:(nullable PFQuery *)query; /** Sets an alert message for this push notification. @@ -156,7 +156,7 @@ PF_TV_UNAVAILABLE PF_WATCH_UNAVAILABLE @interface PFPush : NSObject @return The task, that encapsulates the work being done. */ -+ (BFTask PF_GENERIC(NSNumber *)*)sendPushMessageToChannelInBackground:(NSString *)channel withMessage:(NSString *)message; ++ (BFTask *)sendPushMessageToChannelInBackground:(NSString *)channel withMessage:(NSString *)message; /** *Asynchronously* sends a push message to a channel and calls the given block. @@ -177,8 +177,8 @@ PF_TV_UNAVAILABLE PF_WATCH_UNAVAILABLE @interface PFPush : NSObject @return The task, that encapsulates the work being done. */ -+ (BFTask PF_GENERIC(NSNumber *)*)sendPushMessageToQueryInBackground:(PFQuery PF_GENERIC(PFInstallation *)*)query - withMessage:(NSString *)message; ++ (BFTask *)sendPushMessageToQueryInBackground:(PFQuery *)query + withMessage:(NSString *)message; /** *Asynchronously* sends a push message to a query and calls the given block. @@ -189,7 +189,7 @@ PF_TV_UNAVAILABLE PF_WATCH_UNAVAILABLE @interface PFPush : NSObject @param block The block to execute. It should have the following argument signature: `^(BOOL succeeded, NSError *error)` */ -+ (void)sendPushMessageToQueryInBackground:(PFQuery PF_GENERIC(PFInstallation *)*)query ++ (void)sendPushMessageToQueryInBackground:(PFQuery *)query withMessage:(NSString *)message block:(nullable PFBooleanResultBlock)block; @@ -197,7 +197,7 @@ PF_TV_UNAVAILABLE PF_WATCH_UNAVAILABLE @interface PFPush : NSObject *Asynchronously* send this push message. @return The task, that encapsulates the work being done. */ -- (BFTask PF_GENERIC(NSNumber *)*)sendPushInBackground; +- (BFTask *)sendPushInBackground; /** *Asynchronously* send this push message and executes the given callback block. @@ -218,7 +218,7 @@ PF_TV_UNAVAILABLE PF_WATCH_UNAVAILABLE @interface PFPush : NSObject @return The task, that encapsulates the work being done. */ -+ (BFTask PF_GENERIC(NSNumber *)*)sendPushDataToChannelInBackground:(NSString *)channel withData:(NSDictionary *)data; ++ (BFTask *)sendPushDataToChannelInBackground:(NSString *)channel withData:(NSDictionary *)data; /** Asynchronously sends a push message with arbitrary data to a channel and calls the given block. @@ -246,8 +246,8 @@ PF_TV_UNAVAILABLE PF_WATCH_UNAVAILABLE @interface PFPush : NSObject @return The task, that encapsulates the work being done. */ -+ (BFTask PF_GENERIC(NSNumber *)*)sendPushDataToQueryInBackground:(PFQuery PF_GENERIC(PFInstallation *)*)query - withData:(NSDictionary *)data; ++ (BFTask *)sendPushDataToQueryInBackground:(PFQuery *)query + withData:(NSDictionary *)data; /** *Asynchronously* sends a push message with arbitrary data to a query and calls the given block. @@ -260,7 +260,7 @@ PF_TV_UNAVAILABLE PF_WATCH_UNAVAILABLE @interface PFPush : NSObject @param block The block to execute. It should have the following argument signature: `^(BOOL succeeded, NSError *error)`. */ -+ (void)sendPushDataToQueryInBackground:(PFQuery PF_GENERIC(PFInstallation *)*)query ++ (void)sendPushDataToQueryInBackground:(PFQuery *)query withData:(NSDictionary *)data block:(nullable PFBooleanResultBlock)block; @@ -301,7 +301,7 @@ PF_TV_UNAVAILABLE PF_WATCH_UNAVAILABLE @interface PFPush : NSObject @return The task, that encapsulates the work being done. */ -+ (BFTask PF_GENERIC(NSSet *)*)getSubscribedChannelsInBackground; ++ (BFTask *> *)getSubscribedChannelsInBackground; /** *Asynchronously* get all the channels that this device is subscribed to. @@ -318,7 +318,7 @@ PF_TV_UNAVAILABLE PF_WATCH_UNAVAILABLE @interface PFPush : NSObject @return The task, that encapsulates the work being done. */ -+ (BFTask PF_GENERIC(NSNumber *)*)subscribeToChannelInBackground:(NSString *)channel; ++ (BFTask *)subscribeToChannelInBackground:(NSString *)channel; /** *Asynchronously* subscribes the device to a channel of push notifications and calls the given block. @@ -337,7 +337,7 @@ PF_TV_UNAVAILABLE PF_WATCH_UNAVAILABLE @interface PFPush : NSObject @return The task, that encapsulates the work being done. */ -+ (BFTask PF_GENERIC(NSNumber *)*)unsubscribeFromChannelInBackground:(NSString *)channel; ++ (BFTask *)unsubscribeFromChannelInBackground:(NSString *)channel; /** *Asynchronously* unsubscribes the device from a channel of push notifications and calls the given block. diff --git a/Parse/PFPush.m b/Parse/PFPush.m index 50d54355e..1e4f05251 100644 --- a/Parse/PFPush.m +++ b/Parse/PFPush.m @@ -34,7 +34,7 @@ @interface PFPush () @property (nonatomic, strong) PFMutablePushState *state; -@property (nonatomic, strong) PFQuery PF_GENERIC(PFInstallation *)*query; +@property (nonatomic, strong) PFQuery *query; @end @@ -254,7 +254,7 @@ + (void)sendPushDataToQueryInBackground:(PFQuery *)query withData:(NSDictionary #pragma mark Get -+ (BFTask PF_GENERIC(NSSet *)*)getSubscribedChannelsInBackground { ++ (BFTask *>*)getSubscribedChannelsInBackground { return [[self channelsController] getSubscribedChannelsAsync]; } @@ -406,7 +406,7 @@ + (BOOL)sendPushDataToQuery:(PFQuery *)query withData:(NSDictionary *)data error #pragma mark Managing Channel Subscriptions -+ (NSSet PF_GENERIC(NSString *)*)getSubscribedChannels:(NSError **)error { ++ (NSSet *)getSubscribedChannels:(NSError **)error { return [[self getSubscribedChannelsInBackground] waitForResult:error]; } diff --git a/Parse/PFQuery+Synchronous.h b/Parse/PFQuery+Synchronous.h index 0cd317338..2d3428f4d 100644 --- a/Parse/PFQuery+Synchronous.h +++ b/Parse/PFQuery+Synchronous.h @@ -17,7 +17,7 @@ NS_ASSUME_NONNULL_BEGIN Calling one of these synchronous methods could potentially block the current thread for a large amount of time, since it might be fetching from network or saving/loading data from disk. */ -@interface PFQuery PF_GENERIC(PFGenericObject : PFObject *) (Synchronous) +@interface PFQuery (Synchronous) ///-------------------------------------- /// @name Getting Objects by ID @@ -99,7 +99,7 @@ NS_ASSUME_NONNULL_BEGIN @return Returns an array of `PFObject` objects that were found. */ -- (nullable NSArray PF_GENERIC(PFGenericObject) *)findObjects PF_SWIFT_UNAVAILABLE; +- (nullable NSArray *)findObjects PF_SWIFT_UNAVAILABLE; /** Finds objects *synchronously* based on the constructed query and sets an error if there was one. @@ -108,7 +108,7 @@ NS_ASSUME_NONNULL_BEGIN @return Returns an array of `PFObject` objects that were found. */ -- (nullable NSArray PF_GENERIC(PFGenericObject) *)findObjects:(NSError **)error; +- (nullable NSArray *)findObjects:(NSError **)error; ///-------------------------------------- /// @name Getting the First Match in a Query diff --git a/Parse/PFQuery.h b/Parse/PFQuery.h index 25cefc24e..273a62eed 100644 --- a/Parse/PFQuery.h +++ b/Parse/PFQuery.h @@ -21,13 +21,13 @@ NS_ASSUME_NONNULL_BEGIN /** The `PFQuery` class defines a query that is used to query for `PFObject`s. */ -@interface PFQuery PF_GENERIC(PFGenericObject : PFObject *) : NSObject +@interface PFQuery : NSObject ///-------------------------------------- /// @name Blocks ///-------------------------------------- -typedef void (^PFQueryArrayResultBlock)(NSArray PF_GENERIC(PFGenericObject) * __nullable objects, NSError * __nullable error); +typedef void (^PFQueryArrayResultBlock)(NSArray *__nullable objects, NSError * __nullable error); ///-------------------------------------- /// @name Creating a Query for a Class @@ -103,7 +103,7 @@ typedef void (^PFQueryArrayResultBlock)(NSArray PF_GENERIC(PFGenericObject) * __ @return The same instance of `PFQuery` as the receiver. This allows method chaining. */ -- (instancetype)selectKeys:(NSArray PF_GENERIC(NSString *)*)keys; +- (instancetype)selectKeys:(NSArray *)keys; /** Add a constraint that requires a particular key exists. @@ -379,7 +379,7 @@ typedef void (^PFQueryArrayResultBlock)(NSArray PF_GENERIC(PFGenericObject) * __ @return An instance of `PFQuery` that is the `or` of the passed in queries. */ -+ (instancetype)orQueryWithSubqueries:(NSArray PF_GENERIC(PFQuery *)*)queries; ++ (instancetype)orQueryWithSubqueries:(NSArray *)queries; /** Adds a constraint that requires that a key's value matches a value in another key @@ -493,7 +493,7 @@ typedef void (^PFQueryArrayResultBlock)(NSArray PF_GENERIC(PFGenericObject) * __ @return The same instance of `PFQuery` as the receiver. This allows method chaining. */ -- (instancetype)orderBySortDescriptors:(nullable NSArray PF_GENERIC(NSSortDescriptor *)*)sortDescriptors; +- (instancetype)orderBySortDescriptors:(nullable NSArray *)sortDescriptors; ///-------------------------------------- /// @name Getting Objects by ID @@ -509,7 +509,7 @@ typedef void (^PFQueryArrayResultBlock)(NSArray PF_GENERIC(PFGenericObject) * __ @return The task, that encapsulates the work being done. */ -- (BFTask PF_GENERIC(PFGenericObject) *)getObjectInBackgroundWithId:(NSString *)objectId; +- (BFTask *)getObjectInBackgroundWithId:(NSString *)objectId; /** Gets a `PFObject` asynchronously and calls the given block with the result. @@ -542,7 +542,7 @@ typedef void (^PFQueryArrayResultBlock)(NSArray PF_GENERIC(PFGenericObject) * __ @return The task, that encapsulates the work being done. */ -- (BFTask PF_GENERIC(NSArray *)*)findObjectsInBackground; +- (BFTask *> *)findObjectsInBackground; /** Finds objects *asynchronously* and calls the given block with the results. @@ -563,7 +563,7 @@ typedef void (^PFQueryArrayResultBlock)(NSArray PF_GENERIC(PFGenericObject) * __ @return The task, that encapsulates the work being done. */ -- (BFTask PF_GENERIC(PFGenericObject) *)getFirstObjectInBackground; +- (BFTask *)getFirstObjectInBackground; /** Gets an object *asynchronously* and calls the given block with the result. @@ -586,7 +586,7 @@ typedef void (^PFQueryArrayResultBlock)(NSArray PF_GENERIC(PFGenericObject) * __ @return The task, that encapsulates the work being done. */ -- (BFTask PF_GENERIC(NSNumber *)*)countObjectsInBackground; +- (BFTask *)countObjectsInBackground; /** Counts objects *asynchronously* and calls the given block with the counts. diff --git a/Parse/PFSession.h b/Parse/PFSession.h index ff9e27145..6dabf4f0c 100644 --- a/Parse/PFSession.h +++ b/Parse/PFSession.h @@ -37,7 +37,7 @@ typedef void(^PFSessionResultBlock)(PFSession *__nullable session, NSError *__nu @return A task that is `completed` with an instance of `PFSession` class or is `faulted` if the operation fails. */ -+ (BFTask PF_GENERIC(PFSession *)*)getCurrentSessionInBackground; ++ (BFTask *)getCurrentSessionInBackground; /** *Asynchronously* fetches a `PFSession` object related to the current user. diff --git a/Parse/PFSubclassing.h b/Parse/PFSubclassing.h index 0f3eeaa41..6cbd71a26 100644 --- a/Parse/PFSubclassing.h +++ b/Parse/PFSubclassing.h @@ -9,7 +9,7 @@ #import -@class PFQuery PF_GENERIC(PFGenericObject : PFObject *); +@class PFQuery; NS_ASSUME_NONNULL_BEGIN diff --git a/Parse/PFUser.h b/Parse/PFUser.h index e6ec9a16b..76dac76f4 100644 --- a/Parse/PFUser.h +++ b/Parse/PFUser.h @@ -20,7 +20,7 @@ NS_ASSUME_NONNULL_BEGIN typedef void(^PFUserSessionUpgradeResultBlock)(NSError *__nullable error); typedef void(^PFUserLogoutResultBlock)(NSError *__nullable error); -@class PFQuery PF_GENERIC(PFGenericObject : PFObject *); +@class PFQuery; @protocol PFUserAuthenticationDelegate; /** @@ -117,7 +117,7 @@ typedef void(^PFUserLogoutResultBlock)(NSError *__nullable error); @return The task, that encapsulates the work being done. */ -- (BFTask PF_GENERIC(NSNumber *)*)signUpInBackground; +- (BFTask *)signUpInBackground; /** Signs up the user *asynchronously*. @@ -146,7 +146,7 @@ typedef void(^PFUserLogoutResultBlock)(NSError *__nullable error); @return The task, that encapsulates the work being done. */ -+ (BFTask PF_GENERIC(__kindof PFUser *)*)logInWithUsernameInBackground:(NSString *)username password:(NSString *)password; ++ (BFTask<__kindof PFUser *> *)logInWithUsernameInBackground:(NSString *)username password:(NSString *)password; /** Makes an *asynchronous* request to log in a user with specified credentials. @@ -175,7 +175,7 @@ typedef void(^PFUserLogoutResultBlock)(NSError *__nullable error); @return The task, that encapsulates the work being done. */ -+ (BFTask PF_GENERIC(__kindof PFUser *)*)becomeInBackground:(NSString *)sessionToken; ++ (BFTask<__kindof PFUser *> *)becomeInBackground:(NSString *)sessionToken; /** Makes an *asynchronous* request to become a user with the given session token. @@ -253,7 +253,7 @@ typedef void(^PFUserLogoutResultBlock)(NSError *__nullable error); @param email Email of the account to send a reset password request. @return The task, that encapsulates the work being done. */ -+ (BFTask PF_GENERIC(NSNumber *)*)requestPasswordResetForEmailInBackground:(NSString *)email; ++ (BFTask *)requestPasswordResetForEmailInBackground:(NSString *)email; /** Send a password reset request *asynchronously* for a specified email. @@ -293,8 +293,8 @@ typedef void(^PFUserLogoutResultBlock)(NSError *__nullable error); @return A `BFTask` that is resolved to `PFUser` when logging in completes. */ -+ (BFTask PF_GENERIC(PFUser *)*)logInWithAuthTypeInBackground:(NSString *)authType - authData:(NSDictionary PF_GENERIC(NSString *, NSString *)*)authData; ++ (BFTask<__kindof PFUser *> *)logInWithAuthTypeInBackground:(NSString *)authType + authData:(NSDictionary *)authData; /** Links this user to a third party authentication library. @@ -307,8 +307,8 @@ typedef void(^PFUserLogoutResultBlock)(NSError *__nullable error); @return A `BFTask` that is resolved to `@YES` if linking succeeds. */ -- (BFTask PF_GENERIC(NSNumber *)*)linkWithAuthTypeInBackground:(NSString *)authType - authData:(NSDictionary PF_GENERIC(NSString *, NSString *)*)authData; +- (BFTask *)linkWithAuthTypeInBackground:(NSString *)authType + authData:(NSDictionary *)authData; /** Unlinks this user from a third party authentication library. @@ -320,7 +320,7 @@ typedef void(^PFUserLogoutResultBlock)(NSError *__nullable error); @return A `BFTask` that is resolved to `@YES` if unlinking succeeds. */ -- (BFTask PF_GENERIC(NSNumber *)*)unlinkWithAuthTypeInBackground:(NSString *)authType; +- (BFTask *)unlinkWithAuthTypeInBackground:(NSString *)authType; /** Indicates whether this user is linked with a third party authentication library of a specific type. diff --git a/Parse/PFUser.m b/Parse/PFUser.m index 921a29712..845b56eaa 100644 --- a/Parse/PFUser.m +++ b/Parse/PFUser.m @@ -96,8 +96,8 @@ + (BFTask *)_getCurrentUserSessionTokenAsync { #pragma mark Validation -- (BFTask PF_GENERIC(PFVoid) *)_validateDeleteAsync { - return [[super _validateDeleteAsync] continueWithSuccessBlock:^id(BFTask PF_GENERIC(PFVoid) *task) { +- (BFTask *)_validateDeleteAsync { + return [[super _validateDeleteAsync] continueWithSuccessBlock:^id(BFTask *task) { if (!self.authenticated) { NSError *error = [PFErrorUtilities errorWithCode:kPFErrorUserCannotBeAlteredWithoutSession message:@"User cannot be deleted unless they have been authenticated."]; @@ -107,8 +107,8 @@ + (BFTask *)_getCurrentUserSessionTokenAsync { }]; } -- (BFTask PF_GENERIC(PFVoid) *)_validateSaveEventuallyAsync { - return [[super _validateSaveEventuallyAsync] continueWithSuccessBlock:^id(BFTask PF_GENERIC(PFVoid) *task) { +- (BFTask *)_validateSaveEventuallyAsync { + return [[super _validateSaveEventuallyAsync] continueWithSuccessBlock:^id(BFTask *task) { if ([self isDirtyForKey:PFUserPasswordRESTKey]) { NSError *error = [PFErrorUtilities errorWithCode:kPFErrorOperationForbidden message:@"Unable to saveEventually a PFUser with dirty password."]; @@ -821,8 +821,8 @@ + (void)registerAuthenticationDelegate:(id)delegat #pragma mark Log In -+ (BFTask PF_GENERIC(PFUser *)*)logInWithAuthTypeInBackground:(NSString *)authType - authData:(NSDictionary PF_GENERIC(NSString *, NSString *)*)authData { ++ (BFTask<__kindof PFUser *> *)logInWithAuthTypeInBackground:(NSString *)authType + authData:(NSDictionary *)authData { PFParameterAssert(authType, @"Can't log in without `authType`."); PFParameterAssert(authData, @"Can't log in without `authData`."); PFUserAuthenticationController *controller = [self authenticationController]; @@ -835,8 +835,8 @@ + (void)registerAuthenticationDelegate:(id)delegat #pragma mark Link -- (BFTask PF_GENERIC(NSNumber *)*)linkWithAuthTypeInBackground:(NSString *)authType - authData:(NSDictionary PF_GENERIC(NSString *, NSString *)*)newAuthData { +- (BFTask *)linkWithAuthTypeInBackground:(NSString *)authType + authData:(NSDictionary *)newAuthData { PFParameterAssert(authType, @"Can't link without `authType`."); PFParameterAssert(newAuthData, @"Can't link without `authData`."); PFUserAuthenticationController *controller = [[self class] authenticationController]; diff --git a/Parse/PFUserAuthenticationDelegate.h b/Parse/PFUserAuthenticationDelegate.h index 9c1eea7db..8484a6fd3 100644 --- a/Parse/PFUserAuthenticationDelegate.h +++ b/Parse/PFUserAuthenticationDelegate.h @@ -29,7 +29,7 @@ NS_ASSUME_NONNULL_BEGIN @return `YES` - if the `authData` was succesfully synchronized, or `NO` if user should not longer be associated because of bad `authData`. */ -- (BOOL)restoreAuthenticationWithAuthData:(nullable NSDictionary PF_GENERIC(NSString *, NSString *)*)authData; +- (BOOL)restoreAuthenticationWithAuthData:(nullable NSDictionary *)authData; @end