I need to save a file to the main app's documents directory from my action extension. Is this possible? If so how should I go about it? I have noticed that the path given by the code below is different when called from the main app and the the extension.
NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0]
I found help from "Sharing data between an iOS 8 share extension and main app" on how to share user defaults. But document directory is still a mystery to me.