Skip to content

Instantly share code, notes, and snippets.

@jwhitehorn
Created January 1, 2018 20:53
Show Gist options
  • Save jwhitehorn/fa9b568450a905c2888f106c0b456db4 to your computer and use it in GitHub Desktop.
Save jwhitehorn/fa9b568450a905c2888f106c0b456db4 to your computer and use it in GitHub Desktop.
- (BOOL) isUpdatePending {
NSArray *documentPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectoryPath = [documentPaths objectAtIndex:0];
NSString *filePath = [documentsDirectoryPath stringByAppendingPathComponent:@"updated.db"];
NSFileManager *fileManager = [NSFileManager defaultManager];
return [fileManager fileExistsAtPath:filePath];
}
- (BOOL) hasPerformedInitialSync {
NSArray *documentPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectoryPath = [documentPaths objectAtIndex:0];
NSString *filePath = [documentsDirectoryPath stringByAppendingPathComponent:@"database.db"];
NSFileManager *fileManager = [NSFileManager defaultManager];
return [fileManager fileExistsAtPath:filePath];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment