Skip to content
This repository has been archived by the owner on Jan 16, 2021. It is now read-only.

Remove all usages of PF_GENERIC macro. #222

Merged
merged 1 commit into from
Jan 7, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ NS_ASSUME_NONNULL_BEGIN
If unspecified, the default is basic facebook permissions.
*/
@property (nullable, nonatomic, copy) NSArray PF_GENERIC(NSString *)*facebookPermissions;
@property (nullable, nonatomic, copy) NSArray<NSString *> *facebookPermissions;

/**
The sign up controller if sign up is enabled.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

NS_ASSUME_NONNULL_BEGIN

@class BFTask PF_GENERIC(__covariant BFGenericType);
@class BFTask<__covariant BFGenericType>;
@class PFCollectionViewCell;
@class PFObject;
@class PFQuery;
Expand Down Expand Up @@ -127,7 +127,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
The array of instances of `PFObject` that is used as a data source.
*/
@property (nonatomic, copy, readonly) NSArray PF_GENERIC(__kindof PFObject *)*objects;
@property (nonatomic, copy, readonly) NSArray<__kindof PFObject *> *objects;

/**
Returns an object at a particular indexPath.
Expand All @@ -149,7 +149,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
Removes all objects at the specified index paths, animated.
*/
- (void)removeObjectsAtIndexPaths:(nullable NSArray PF_GENERIC(NSIndexPath *)*)indexes;
- (void)removeObjectsAtIndexPaths:(nullable NSArray<NSIndexPath *> *)indexes;

///--------------------------------------
/// @name Loading Data
Expand All @@ -160,7 +160,7 @@ NS_ASSUME_NONNULL_BEGIN
@return An awaitable task that completes when the reload succeeds
*/
- (BFTask PF_GENERIC(NSArray<__kindof PFObject *>*)*)loadObjects;
- (BFTask<NSArray<__kindof PFObject *> *> *)loadObjects;

/**
Loads the objects of the `PFObject.parseClassName` at the specified page and appends it to the
Expand All @@ -171,7 +171,7 @@ NS_ASSUME_NONNULL_BEGIN
@return An awaitable task that completes when the reload succeeds
*/
- (BFTask PF_GENERIC(NSArray<__kindof PFObject *>*)*)loadObjects:(NSInteger)page clear:(BOOL)clear;
- (BFTask<NSArray<__kindof PFObject *> *> *)loadObjects:(NSInteger)page clear:(BOOL)clear;

/**
Loads the next page of objects, appends to table, and refreshes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
static NSString *const PFQueryCollectionViewNextPageReusableViewIdentifier = @"nextPageView";

@interface PFQueryCollectionViewController () {
NSMutableArray PF_GENERIC(PFObject *)*_mutableObjects;
NSMutableArray<PFObject *> *_mutableObjects;

BOOL _firstLoad; // Whether we have loaded the first set of objects
NSInteger _currentPage; // The last page that was loaded
Expand Down Expand Up @@ -226,18 +226,18 @@ - (void)removeObjectsAtIndexPaths:(NSArray *)indexPaths {
#pragma mark -
#pragma mark Loading Data

- (BFTask PF_GENERIC(NSArray<__kindof PFObject *>*)*)loadObjects {
- (BFTask<NSArray<__kindof PFObject *> *> *)loadObjects {
return [self loadObjects:0 clear:YES];
}

- (BFTask PF_GENERIC(NSArray<__kindof PFObject *>*)*)loadObjects:(NSInteger)page clear:(BOOL)clear {
- (BFTask<NSArray<__kindof PFObject *> *> *)loadObjects:(NSInteger)page clear:(BOOL)clear {
self.loading = YES;
[self objectsWillLoad];

PFQuery *query = [self queryForCollection];
[self _alterQuery:query forLoadingPage:page];

BFTaskCompletionSource PF_GENERIC(NSArray<__kindof PFObject *>*)*source = [BFTaskCompletionSource taskCompletionSource];
BFTaskCompletionSource<NSArray<__kindof PFObject *> *> *source = [BFTaskCompletionSource taskCompletionSource];
[query findObjectsInBackgroundWithBlock:^(NSArray *foundObjects, NSError *error) {
if (![Parse isLocalDatastoreEnabled] &&
query.cachePolicy != kPFCachePolicyCacheOnly &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

NS_ASSUME_NONNULL_BEGIN

@class BFTask PF_GENERIC(__covariant BFGenericType);
@class BFTask<__covariant BFGenericType>;
@class PFObject;
@class PFQuery;
@class PFTableViewCell;
Expand Down Expand Up @@ -149,7 +149,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
The array of instances of `PFObject` that is used as a data source.
*/
@property (nullable, nonatomic, copy, readonly) NSArray PF_GENERIC(__kindof PFObject *)*objects;
@property (nullable, nonatomic, copy, readonly) NSArray<__kindof PFObject *> *objects;

/**
Returns an object at a particular indexPath.
Expand All @@ -176,12 +176,12 @@ NS_ASSUME_NONNULL_BEGIN
/**
Removes all objects at the specified index paths, animated.
*/
- (void)removeObjectsAtIndexPaths:(nullable NSArray PF_GENERIC(NSIndexPath *)*)indexPaths;
- (void)removeObjectsAtIndexPaths:(nullable NSArray<NSIndexPath *> *)indexPaths;

/**
Removes all objects at the specified index paths, with or without animation.
*/
- (void)removeObjectsAtIndexPaths:(nullable NSArray PF_GENERIC(NSIndexPath *)*)indexPaths animated:(BOOL)animated;
- (void)removeObjectsAtIndexPaths:(nullable NSArray<NSIndexPath *> *)indexPaths animated:(BOOL)animated;

/**
Clears the table of all objects.
Expand All @@ -193,7 +193,7 @@ NS_ASSUME_NONNULL_BEGIN
@return An awaitable task that completes when the reload succeeds
*/
- (BFTask PF_GENERIC(NSArray<__kindof PFObject *> *)*)loadObjects;
- (BFTask<NSArray<__kindof PFObject *> *> *)loadObjects;

/**
Loads the objects of the className at the specified page and appends it to the
Expand All @@ -204,7 +204,7 @@ NS_ASSUME_NONNULL_BEGIN
@return An awaitable task that completes when the reload succeeds
*/
- (BFTask PF_GENERIC(NSArray<__kindof PFObject *> *)*)loadObjects:(NSInteger)page clear:(BOOL)clear;
- (BFTask<NSArray<__kindof PFObject *> *> *)loadObjects:(NSInteger)page clear:(BOOL)clear;

/**
Loads the next page of objects, appends to table, and refreshes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ - (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibB
@end

@interface PFQueryTableViewController () {
NSMutableArray PF_GENERIC(PFObject *)*_mutableObjects;
NSMutableArray<PFObject *> *_mutableObjects;

BOOL _firstLoad; // Whether we have loaded the first set of objects
NSInteger _currentPage; // The last page that was loaded
Expand Down Expand Up @@ -212,18 +212,18 @@ - (void)clear {
_currentPage = 0;
}

- (BFTask PF_GENERIC(NSArray<__kindof PFObject *>*)*)loadObjects {
- (BFTask<NSArray<__kindof PFObject *> *> *)loadObjects {
return [self loadObjects:0 clear:YES];
}

- (BFTask PF_GENERIC(NSArray<__kindof PFObject *>*)*)loadObjects:(NSInteger)page clear:(BOOL)clear {
- (BFTask<NSArray<__kindof PFObject *> *> *)loadObjects:(NSInteger)page clear:(BOOL)clear {
self.loading = YES;
[self objectsWillLoad];

PFQuery *query = [self queryForTable];
[self _alterQuery:query forLoadingPage:page];

BFTaskCompletionSource PF_GENERIC(NSArray<__kindof PFObject *>*)*source = [BFTaskCompletionSource taskCompletionSource];
BFTaskCompletionSource<NSArray<__kindof PFObject *> *> *source = [BFTaskCompletionSource taskCompletionSource];
[query findObjectsInBackgroundWithBlock:^(NSArray *foundObjects, NSError *error) {
if (![Parse isLocalDatastoreEnabled] &&
query.cachePolicy != kPFCachePolicyCacheOnly &&
Expand Down Expand Up @@ -558,7 +558,7 @@ - (void)_refreshControlValueChanged:(UIRefreshControl *)refreshControl {
#pragma mark -
#pragma mark Accessors

- (NSArray PF_GENERIC(__kindof PFObject *)*)objects {
- (NSArray<__kindof PFObject *> *)objects {
return _mutableObjects;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ extern NSString *const PFSignUpCancelNotification;
@return A `BOOL` indicating whether the sign up should proceed.
*/
- (BOOL)signUpViewController:(PFSignUpViewController *)signUpController shouldBeginSignUp:(NSDictionary PF_GENERIC(NSString *,NSString *)*)info;
- (BOOL)signUpViewController:(PFSignUpViewController *)signUpController shouldBeginSignUp:(NSDictionary<NSString *, NSString *> *)info;

///--------------------------------------
/// @name Responding to Actions
Expand Down
4 changes: 2 additions & 2 deletions ParseUI/Classes/Views/PFImageView.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ NS_ASSUME_NONNULL_BEGIN

typedef void(^PFImageViewImageResultBlock)(UIImage *__nullable image, NSError *__nullable error);

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

/**
Expand All @@ -51,7 +51,7 @@ typedef void(^PFImageViewImageResultBlock)(UIImage *__nullable image, NSError *
@return The task, that encapsulates the work being done.
*/
- (BFTask PF_GENERIC(UIImage *)*)loadInBackground;
- (BFTask<UIImage *> *)loadInBackground;

/**
Initiate downloading of the remote image.
Expand Down
4 changes: 2 additions & 2 deletions ParseUI/Classes/Views/PFImageView.m
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ - (void)setFile:(PFFile *)otherFile {
#pragma mark -
#pragma mark Load

- (BFTask PF_GENERIC(UIImage *)*)loadInBackground {
BFTaskCompletionSource PF_GENERIC(UIImage *)*source = [BFTaskCompletionSource taskCompletionSource];
- (BFTask<UIImage *> *)loadInBackground {
BFTaskCompletionSource<UIImage *> *source = [BFTaskCompletionSource taskCompletionSource];
[self loadInBackground:^(UIImage *image, NSError *error) {
if (error) {
[source trySetError:error];
Expand Down