Skip to content

Commit 1347567

Browse files
mmannoobs2ninjas
authored andcommitted
Add support for using URLCache on macCatalyst (#1460)
* Add support for using URLCache on macCatalyst * use recommended TARGET_OS_MACCATALYST instead of deprecated UIKITFORMAC
1 parent 7be3ea3 commit 1347567

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Parse/Parse/Internal/Commands/CommandRunner/URLSession/PFURLSessionCommandRunner.m

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,10 +268,17 @@ + (NSURLSessionConfiguration *)_urlSessionConfigurationForApplicationId:(NSStrin
268268
configuration.HTTPCookieAcceptPolicy = NSHTTPCookieAcceptPolicyNever;
269269
configuration.HTTPShouldSetCookies = NO;
270270

271+
#if TARGET_OS_MACCATALYST
272+
// Completely disable caching of responses for security reasons.
273+
configuration.URLCache = [[NSURLCache alloc] initWithMemoryCapacity:[NSURLCache sharedURLCache].memoryCapacity
274+
diskCapacity:0
275+
directoryURL:nil];
276+
#else
271277
// Completely disable caching of responses for security reasons.
272278
configuration.URLCache = [[NSURLCache alloc] initWithMemoryCapacity:[NSURLCache sharedURLCache].memoryCapacity
273279
diskCapacity:0
274280
diskPath:nil];
281+
#endif
275282

276283
NSBundle *bundle = [NSBundle mainBundle];
277284
NSDictionary *headers = [PFCommandURLRequestConstructor defaultURLRequestHeadersForApplicationId:applicationId

0 commit comments

Comments
 (0)