2

Using Swift, what method do you need to implement in order to act on an incoming file (e.g. a user clicking on an email attachment which has a file type specified by your app's Document Type / Exported UTI)?

I have seen this answer which refers to using the ObjC method -application:didFinishLaunchingWithOptions:. The equivalent in Swift would be:

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {...}

but I'm not clear on the implementation details to handle the incoming file. Is the file dropped into some folder accessible to the receiving app? Is there a URL to the file?

How do you implement the receipt of the file in Swift?

Community
  • 1
  • 1
Bionic_Geek
  • 536
  • 4
  • 24

1 Answers1

0

If you are handed a file in this way, it goes into your Inbox folder (which is created, if necessary, in your Documents folder).

Documentation here:

https://developer.apple.com/library/ios/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/FileSystemOverview/FileSystemOverview.html

matt
  • 515,959
  • 87
  • 875
  • 1,141