Skip to content

Commit 0073c27

Browse files
committed
Replace custom target conditional macros.
1 parent 3a79298 commit 0073c27

File tree

8 files changed

+16
-16
lines changed

8 files changed

+16
-16
lines changed

Parse/Internal/Object/PFObjectPrivate.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797

9898
- (PFObjectEstimatedData *)_estimatedData;
9999

100-
#if PARSE_OSX_ONLY
100+
#if PF_TARGET_OS_OSX
101101
// Not available publicly, but available for testing
102102

103103
- (instancetype)refresh;

Parse/Internal/PFFileManager.m

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,12 @@ - (instancetype)initWithApplicationIdentifier:(NSString *)applicationIdentifier
246246
- (NSString *)parseDefaultDataDirectoryPath {
247247
// NSHomeDirectory: Returns the path to either the user's or application's
248248
// home directory, depending on the platform. Sandboxed by default on iOS.
249-
#if PARSE_IOS_ONLY
249+
#if PF_TARGET_OS_OSX
250+
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES);
251+
NSString *directoryPath = [paths firstObject];
252+
directoryPath = [directoryPath stringByAppendingPathComponent:_PFFileManagerParseDirectoryName];
253+
directoryPath = [directoryPath stringByAppendingPathComponent:self.applicationIdentifier];
254+
#else
250255
NSString *directoryPath = nil;
251256
if (self.applicationGroupIdentifier) {
252257
NSURL *containerPath = [[NSFileManager defaultManager] containerURLForSecurityApplicationGroupIdentifier:self.applicationGroupIdentifier];
@@ -255,11 +260,6 @@ - (NSString *)parseDefaultDataDirectoryPath {
255260
} else {
256261
return [self parseLocalSandboxDataDirectoryPath];
257262
}
258-
#else
259-
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES);
260-
NSString *directoryPath = [paths firstObject];
261-
directoryPath = [directoryPath stringByAppendingPathComponent:_PFFileManagerParseDirectoryName];
262-
directoryPath = [directoryPath stringByAppendingPathComponent:self.applicationIdentifier];
263263
#endif
264264

265265
BFTask *createDirectoryTask = [[self class] createDirectoryIfNeededAsyncAtPath:directoryPath

Parse/PFConstants.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ extern NSInteger const PARSE_API_VERSION;
2424
#pragma mark - Platform
2525
///--------------------------------------
2626

27-
#define PARSE_IOS_ONLY (TARGET_OS_IPHONE)
28-
#define PARSE_OSX_ONLY (TARGET_OS_MAC && !(TARGET_OS_IPHONE))
29-
3027
extern NSString *const _Nonnull kPFDeviceType;
3128

3229
///--------------------------------------

Parse/PFObject.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
394394
*/
395395
@property (nonatomic, assign, readonly, getter=isDataAvailable) BOOL dataAvailable;
396396

397-
#if PARSE_IOS_ONLY
397+
#if TARGET_OS_IOS
398398

399399
/**
400400
Refreshes the PFObject with the current data from the server.

Parse/PFPush.m

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#import "PFQueryPrivate.h"
2929
#import "PFUserPrivate.h"
3030
#import "Parse_Private.h"
31+
#import "PFApplication.h"
3132

3233
static Class _pushInternalUtilClass = nil;
3334

@@ -286,9 +287,9 @@ + (void)unsubscribeFromChannelInBackground:(NSString *)channel block:(PFBooleanR
286287
#pragma mark - Handling Notifications
287288
///--------------------------------------
288289

289-
#if PARSE_IOS_ONLY
290+
#if TARGET_OS_IOS
290291
+ (void)handlePush:(NSDictionary *)userInfo {
291-
UIApplication *application = [UIApplication sharedApplication];
292+
UIApplication *application = [PFApplication currentApplication].systemApplication;
292293
if (application.applicationState != UIApplicationStateActive) {
293294
return;
294295
}

Parse/Parse.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ NS_ASSUME_NONNULL_BEGIN
171171
*/
172172
+ (NSString *)containingApplicationBundleIdentifierForDataSharing PF_WATCH_UNAVAILABLE PF_TV_UNAVAILABLE;
173173

174-
#if PARSE_IOS_ONLY
174+
#if TARGET_OS_IOS
175175

176176
///--------------------------------------
177177
#pragma mark - Configuring UI Settings

Parse/Parse.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ + (BOOL)isLocalDatastoreEnabled {
186186
#pragma mark - User Interface
187187
///--------------------------------------
188188

189-
#if PARSE_IOS_ONLY
189+
#if TARGET_OS_IOS
190190

191191
+ (void)offlineMessagesEnabled:(BOOL)enabled {
192192
// Deprecated method - shouldn't do anything.

Tests/Other/LocationManager/CLLocationManager+TestAdditions.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
#import "CLLocationManager+TestAdditions.h"
1111

12+
#import <Parse/PFConstants.h>
13+
1214
#import "PFTestSwizzlingUtilities.h"
1315

1416
@interface CLLocationManager ()
@@ -31,7 +33,7 @@ @implementation CLLocationManager (TestAdditions)
3133

3234
+ (void)setMockingEnabled:(BOOL)enabled {
3335
// There is no ability to use real CLLocationManager on Mac, due to permission requests
34-
#if PARSE_OSX_ONLY
36+
#if PF_TARGET_OS_OSX
3537
if (!enabled) {
3638
return;
3739
}

0 commit comments

Comments
 (0)