I have run into a weird issue. All was running well, but when I played around with the settings below, when I drag the prioritized tasklist on to the simulator, rather than starting TaskList it opens Files and asks me where I want to save the file. Nothing else has changed. I’m wondering, is it possible that I’ve typed it in correctly (it seems to be correct to me) but it hasn’t accessed the proper internal properties (assuming that UITypeTagSpecification is not just a made up label)?
I have one more question, if anyone is reading this. Dragging a file, or clicking on it - if open files in place is set - starts the app up. How can you get it to open on the screen that you want? Would this be set in the openURLContexts method, or somewhere else?
Hello @religionofpeas,
My apologies for not getting back to you much sooner :]
The idea of setting up the URL is for the iOS to know which app to open when you setup the URL scheme, what the OS actually does is pass the whole URL to your app as it opens.
No worries, ehabamer, and thanks for your reply. I have sorted out getting the screen that I want, using this code:
if let tabBarController = self.window!.rootViewController as? UITabBarController {
tabBarController.selectedIndex = 1
}
I’m having difficulty though in using SceneDelegate. I don’t want my app to run in the background, but when it isn’t running in the background openURLContexts does not get called.
I came across the below discussion in stackOverFlow about calling openURLContexts manually, but the code they use isn’t working for me - at least not in the simulator. Nothing gets called in the AppDelegate either. Any ideas on to how to call it?
However, I’m having an issue with the non-scene version (I haven’t tired the scene version since I’m not using scenes). The openURL function is being called in response to sharing a file from the Files.app to my app, but the URL I receive doesn’t point to an actual file. It seems like a valid URL and the file name it references is correct, but I used FIleManager.fileExists() on the URL and it says it doesn’t exist. I output the directory contents of the URL (tmp directory for my app) to the log and there is nothing in it.