Skip to content

Commit

Permalink
Remove PF_GENERIC macro from the SDK.
Browse files Browse the repository at this point in the history
This is no longer needed as we will not be supporting Xcode 6 in the
future.

Fixes #674.
  • Loading branch information
richardjrossiii committed Jan 5, 2016
1 parent 3a1bb8b commit 20db241
Show file tree
Hide file tree
Showing 85 changed files with 397 additions and 413 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

#import "PFCoreDataProvider.h"

@class BFTask PF_GENERIC(__covariant BFGenericType);
@class BFTask<__covariant BFGenericType>;
@class PFACL;

NS_ASSUME_NONNULL_BEGIN
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ + (instancetype)controllerWithDataSource:(id<PFCurrentUserControllerProvider>)da
#pragma mark - ACL
///--------------------------------------

- (BFTask PF_GENERIC(PFACL *)*)getDefaultACLAsync {
- (BFTask<PFACL *> *)getDefaultACLAsync {
return [_taskQueue enqueue:^id(BFTask *task) {
if (!_defaultACL || !_useCurrentUser) {
return _defaultACL;
Expand All @@ -72,7 +72,7 @@ + (instancetype)controllerWithDataSource:(id<PFCurrentUserControllerProvider>)da
}];
}

- (BFTask PF_GENERIC(PFACL *)*)setDefaultACLAsync:(PFACL *)acl withCurrentUserAccess:(BOOL)accessForCurrentUser {
- (BFTask<PFACL *> *)setDefaultACLAsync:(PFACL *)acl withCurrentUserAccess:(BOOL)accessForCurrentUser {
return [_taskQueue enqueue:^id(BFTask *task) {
_defaultACLWithCurrentUser = nil;
_lastCurrentUser = nil;
Expand Down
12 changes: 6 additions & 6 deletions Parse/Internal/Analytics/Controller/PFAnalyticsController.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#import "PFDataProvider.h"
#import "PFMacros.h"

@class BFTask PF_GENERIC(__covariant BFGenericType);
@class BFTask<__covariant BFGenericType>;

NS_ASSUME_NONNULL_BEGIN

Expand Down Expand Up @@ -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<PFVoid> *)trackAppOpenedEventAsyncWithRemoteNotificationPayload:(nullable NSDictionary *)payload
sessionToken:(nullable NSString *)sessionToken;

/**
Tracks the occurrence of a custom event with additional dimensions.
Expand All @@ -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<PFVoid> *)trackEventAsyncWithName:(NSString *)name
dimensions:(nullable NSDictionary<NSString *, NSString *> *)dimensions
sessionToken:(nullable NSString *)sessionToken;

@end

Expand Down
10 changes: 5 additions & 5 deletions Parse/Internal/Analytics/Controller/PFAnalyticsController.m
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ + (instancetype)controllerWithDataSource:(id<PFEventuallyQueueProvider>)dataSour
#pragma mark - Track Event
///--------------------------------------

- (BFTask PF_GENERIC(PFVoid)*)trackAppOpenedEventAsyncWithRemoteNotificationPayload:(nullable NSDictionary *)payload
sessionToken:(nullable NSString *)sessionToken {
- (BFTask<PFVoid> *)trackAppOpenedEventAsyncWithRemoteNotificationPayload:(nullable NSDictionary *)payload
sessionToken:(nullable NSString *)sessionToken {
@weakify(self);
return [[BFTask taskFromExecutor:[BFExecutor defaultPriorityBackgroundExecutor] withBlock:^id{
@strongify(self);
Expand All @@ -65,9 +65,9 @@ + (instancetype)controllerWithDataSource:(id<PFEventuallyQueueProvider>)dataSour
}] continueWithSuccessResult:nil];
}

- (BFTask PF_GENERIC(PFVoid)*)trackEventAsyncWithName:(NSString *)name
dimensions:(nullable NSDictionary PF_GENERIC(NSString *, NSString *)*)dimensions
sessionToken:(nullable NSString *)sessionToken {
- (BFTask<PFVoid> *)trackEventAsyncWithName:(NSString *)name
dimensions:(nullable NSDictionary<NSString *, NSString *> *)dimensions
sessionToken:(nullable NSString *)sessionToken {
PFParameterAssert([[name stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] length],
@"A name for the custom event must be provided.");

Expand Down
2 changes: 1 addition & 1 deletion Parse/Internal/CloudCode/PFCloudCodeController.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#import <Parse/PFConstants.h>
#import "PFDataProvider.h"

@class BFTask PF_GENERIC(__covariant BFGenericType);
@class BFTask<__covariant BFGenericType>;

@interface PFCloudCodeController : NSObject

Expand Down
2 changes: 1 addition & 1 deletion Parse/Internal/Commands/CommandRunner/PFCommandRunning.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

#import "PFDataProvider.h"

@class BFTask PF_GENERIC(BFGenericType);
@class BFTask<__covariant BFGenericType>;
@class PFRESTCommand;

@interface PFCommandURLRequestConstructor : NSObject
Expand All @@ -32,15 +32,15 @@
/// @name Data
///--------------------------------------

- (BFTask PF_GENERIC(NSURLRequest *)*)getDataURLRequestAsyncForCommand:(PFRESTCommand *)command;
- (BFTask<NSURLRequest *> *)getDataURLRequestAsyncForCommand:(PFRESTCommand *)command;

///--------------------------------------
/// @name File Upload
///--------------------------------------

- (BFTask PF_GENERIC(NSURLRequest *)*)getFileUploadURLRequestAsyncForCommand:(PFRESTCommand *)command
withContentType:(NSString *)contentType
contentSourceFilePath:(NSString *)contentFilePath;
- (BFTask<NSURLRequest *> *)getFileUploadURLRequestAsyncForCommand:(PFRESTCommand *)command
withContentType:(NSString *)contentType
contentSourceFilePath:(NSString *)contentFilePath;

///--------------------------------------
/// @name Headers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ + (instancetype)constructorWithDataSource:(id<PFInstallationIdentifierStoreProvi
#pragma mark - Data
///--------------------------------------

- (BFTask PF_GENERIC(NSURLRequest *)*)getDataURLRequestAsyncForCommand:(PFRESTCommand *)command {
return (BFTask *)[[self _getURLRequestHeadersAsyncForCommand:command] continueWithSuccessBlock:^id(BFTask PF_GENERIC(NSDictionary *)*task) {
- (BFTask<NSURLRequest *> *)getDataURLRequestAsyncForCommand:(PFRESTCommand *)command {
return (BFTask *)[[self _getURLRequestHeadersAsyncForCommand:command] continueWithSuccessBlock:^id(BFTask<NSDictionary *> *task) {
NSURL *url = [PFURLConstructor URLFromAbsoluteString:self.serverURL.absoluteString
path:command.httpPath
query:nil];
Expand Down Expand Up @@ -89,10 +89,10 @@ + (instancetype)constructorWithDataSource:(id<PFInstallationIdentifierStoreProvi
#pragma mark - File
///--------------------------------------

- (BFTask PF_GENERIC(NSURLRequest *)*)getFileUploadURLRequestAsyncForCommand:(PFRESTCommand *)command
withContentType:(NSString *)contentType
contentSourceFilePath:(NSString *)contentFilePath {
return [[self getDataURLRequestAsyncForCommand:command] continueWithSuccessBlock:^id(BFTask PF_GENERIC(NSURLRequest *)*task) {
- (BFTask<NSURLRequest *> *)getFileUploadURLRequestAsyncForCommand:(PFRESTCommand *)command
withContentType:(NSString *)contentType
contentSourceFilePath:(NSString *)contentFilePath {
return [[self getDataURLRequestAsyncForCommand:command] continueWithSuccessBlock:^id(BFTask<NSURLRequest *> *task) {
NSMutableURLRequest *request = [task.result mutableCopy];

if (contentType) {
Expand Down Expand Up @@ -145,14 +145,14 @@ + (NSDictionary *)defaultURLRequestHeadersForApplicationId:(NSString *)applicati
return [mutableHeaders copy];
}

- (BFTask PF_GENERIC(NSDictionary *)*)_getURLRequestHeadersAsyncForCommand:(PFRESTCommand *)command {
- (BFTask<NSDictionary *> *)_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 <NSString *>*task) {
headers[PFCommandHeaderNameInstallationId] = task.result;
return [headers copy];
}];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ - (instancetype)initWithDataSource:(id<PFInstallationIdentifierStoreProvider>)da
applicationId:applicationId
clientKey:clientKey
serverURL:serverURL];

}

- (instancetype)initWithDataSource:(id<PFInstallationIdentifierStoreProvider>)dataSource
Expand Down Expand Up @@ -145,16 +144,16 @@ - (void)dealloc {
#pragma mark - Data Commands
///--------------------------------------

- (BFTask PF_GENERIC(PFCommandResult *)*)runCommandAsync:(PFRESTCommand *)command withOptions:(PFCommandRunningOptions)options {
- (BFTask<PFCommandResult *> *)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<PFCommandResult *> *)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 <NSURLRequest *>*task) {
return [_session performDataURLRequestAsync:task.result forCommand:command cancellationToken:cancellationToken];
}];
} withOptions:options cancellationToken:cancellationToken];
Expand All @@ -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<PFCommandResult *> *)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<NSURLRequest *> *task) {
return [_session performFileUploadURLRequestAsync:task.result
forCommand:command
withContentSourceFilePath:sourceFilePath
Expand All @@ -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<PFCommandResult *> *)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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

@class BFCancellationToken;

@class BFTask PF_GENERIC(__covariant BFGenericType);
@class BFTask<__covariant BFGenericType>;
@class PFRESTCommand;

NS_ASSUME_NONNULL_BEGIN
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

@class BFCancellationToken;

@class BFTask PF_GENERIC(__covariant BFGenericType);
@class BFTask <__covariant BFGenericType>;

NS_ASSUME_NONNULL_BEGIN

Expand Down
2 changes: 1 addition & 1 deletion Parse/Internal/Commands/PFRESTObjectBatchCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ NS_ASSUME_NONNULL_BEGIN

@interface PFRESTObjectBatchCommand : PFRESTCommand

+ (instancetype)batchCommandWithCommands:(NSArray PF_GENERIC(PFRESTCommand *)*)commands
+ (instancetype)batchCommandWithCommands:(NSArray<PFRESTCommand *> *)commands
sessionToken:(nullable NSString *)sessionToken
serverURL:(NSURL *)serverURL;

Expand Down
2 changes: 1 addition & 1 deletion Parse/Internal/Commands/PFRESTObjectBatchCommand.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

@implementation PFRESTObjectBatchCommand

+ (nonnull instancetype)batchCommandWithCommands:(nonnull NSArray PF_GENERIC(PFRESTCommand *)*)commands
+ (nonnull instancetype)batchCommandWithCommands:(nonnull NSArray<PFRESTCommand *> *)commands
sessionToken:(nullable NSString *)sessionToken
serverURL:(nonnull NSURL *)serverURL {
PFParameterAssert(commands.count <= PFRESTObjectBatchCommandSubcommandsLimit,
Expand Down
2 changes: 1 addition & 1 deletion Parse/Internal/Config/Controller/PFConfigController.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

#import "PFDataProvider.h"

@class BFTask PF_GENERIC(__covariant BFGenericType);
@class BFTask<__covariant BFGenericType>;
@class PFConfig;
@class PFCurrentConfigController;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

#import "PFDataProvider.h"

@class BFTask PF_GENERIC(__covariant BFGenericType);
@class BFTask<__covariant BFGenericType>;
@class PFConfig;

@interface PFCurrentConfigController : NSObject
Expand Down
6 changes: 3 additions & 3 deletions Parse/Internal/Config/Controller/PFCurrentConfigController.m
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ + (instancetype)controllerWithDataSource:(id<PFPersistenceControllerProvider>)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<PFConfig *> *task) {
_currentConfig = task.result;
return _currentConfig;
}];
Expand Down Expand Up @@ -106,7 +106,7 @@ - (BFTask *)clearMemoryCachedCurrentConfigAsync {
#pragma mark - Data
///--------------------------------------

- (BFTask PF_GENERIC(PFConfig *)*)_loadConfigAsync {
- (BFTask<PFConfig *> *)_loadConfigAsync {
return [[[self _getPersistenceGroupAsync] continueWithSuccessBlock:^id(BFTask<id<PFPersistenceGroup>> *task) {
return [task.result getDataAsyncForKey:PFConfigCurrentConfigFileName_];
}] continueWithSuccessBlock:^id(BFTask *task) {
Expand All @@ -125,7 +125,7 @@ - (BFTask *)clearMemoryCachedCurrentConfigAsync {
#pragma mark - Convenience
///--------------------------------------

- (BFTask PF_GENERIC(id<PFPersistenceGroup>)*)_getPersistenceGroupAsync {
- (BFTask<id<PFPersistenceGroup>> *)_getPersistenceGroupAsync {
return [self.dataSource.persistenceController getPersistenceGroupAsync];
}

Expand Down
3 changes: 1 addition & 2 deletions Parse/Internal/File/Controller/PFFileController.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#import "PFMacros.h"

@class BFCancellationToken;
@class BFTask PF_GENERIC(__covariant BFGenericType);
@class BFTask<__covariant BFGenericType>;
@class PFFileState;
@class PFFileStagingController;

Expand All @@ -36,7 +36,6 @@

+ (instancetype)controllerWithDataSource:(id<PFCommandRunnerProvider, PFFileManagerProvider>)dataSource;


///--------------------------------------
/// @name Download
///--------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion Parse/Internal/File/Controller/PFFileStagingController.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#import <Parse/PFConstants.h>

@class BFTask PF_GENERIC(__covariant BFGenericType);
@class BFTask<__covariant BFGenericType>;

NS_ASSUME_NONNULL_BEGIN

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <PFCurrentObjectControlling>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

#import <Parse/PFConstants.h>

@class BFTask PF_GENERIC(BFGenericType);
@class BFTask<__covariant BFGenericType>;

@interface PFInstallationIdentifierStore : NSObject

Expand All @@ -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<NSString *> *)getInstallationIdentifierAsync;

///--------------------------------------
/// @name Clear
Expand Down
Loading

0 comments on commit 20db241

Please sign in to comment.