Last active
August 29, 2015 14:02
-
-
Save mariash/0f58878fb5c5aad9f6a8 to your computer and use it in GitHub Desktop.
Importing documents in iOS application
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url | |
sourceApplication:(NSString *)sourceApplication annotation:(id)annotation | |
{ | |
if (url != nil && [url isFileURL]) { | |
NSError *error; | |
[[MYFileManager sharedInstance] importAttachment:url.path error:&error]; | |
if (error != nil) { | |
[[MYAlertDisplayer sharedInstance] | |
displayAlert:@"Error" withMessage:@"Failed to import file"]; | |
} else { | |
[[MYAlertDisplayer sharedInstance] | |
displayAlert:@"Success" withMessage:@"File was successfully imported"]; | |
} | |
} | |
return YES; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment