How can I have a "Copy To MyExampleApp" in a UIDocumentationController. The file types can be any : pdf,pptx,doc,txt ...
P.S : Objective-C code will be helpful. Thank You !
How can I have a "Copy To MyExampleApp" in a UIDocumentationController. The file types can be any : pdf,pptx,doc,txt ...
P.S : Objective-C code will be helpful. Thank You !
//AppDelegate.m
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication (NSString *)sourceApplication annotation:(id)annotation {
NSString *documentsPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
NSString *filePath = [fileURLFromLaunch path];
BOOL success = [fileManager copyItemAtPath:filePath toPath:finalFilePath error:&error];
if (success) {
NSLog(@"success");
}}
Try Adding DocType Support to your App for the extension and then handle the delegates to do the needful.
Reference: Registering the filetypes your app supports