1

Copy To

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 !

Omkar Jadhav
  • 1,046
  • 3
  • 16
  • 41

2 Answers2

1
//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");
}}
vaibby
  • 1,255
  • 1
  • 9
  • 23
  • No, this is not what I am looking for. Please try to understand the question. – Omkar Jadhav Dec 09 '15 at 05:15
  • @OmkarJadhav I thought u have config the that in Application Info.plist file, This is actual code u have to write after copy clicked – vaibby Jul 27 '18 at 13:16
1

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

Omkar Jadhav
  • 1,046
  • 3
  • 16
  • 41
codelover
  • 1,113
  • 10
  • 28