Posts

Post not yet marked as solved
3 Replies
660 Views
Hi there, I have an iOS app that helps users manage their budget and wondered if it would be possible to integrate Apple Pay in such a way that when the user pays something with Apple Pay the app would get notified and would add the newly paid amount to the user's expenses. Is it possible? If yes, can you point me to an example code? if no, any idea? Regards, Thierry
Posted
by orion98mc.
Last updated
.
Post marked as solved
4 Replies
712 Views
Hi everyone,I'm building a Wiki editor/viewer document based app for one of my projects.The Document file type is a bundle which contains this hierarchy:Example.wikidoc: - stylesheet.css - metadata.json - wiki/ [From here all the wiki articles I.e files and folders containing files]When creating an "untitled" document, in the init() of my NSDocument subclass (Document) I create a temporary "wiki/" directory somewhere on the file system (The App is Sandboxed). I store the "wiki/" directory URL (var wikiRoot: URL) to be used in my view controller to interact with the wiki engine.From there, the user starts editing/adding pages, they are saved in the wikiRoot directory.So far so good... the user saves the document:1) in my override of NSDocument.write(to url: URL, ofType: String)I create a document file wrapper (documentFileWrapper) and add the regular contents for the stylesheet and the metadata and a directory filewrapper for the wiki directory (no content specified)2) I then call: try documentFileWrapper.write(to: url, options: [], originalContentsURL: nil)It saves the contents, with everything. The files and the wiki directory with everything in it. I can check this by showing the contents of the document bundle in the Finder.BUT I should now be changing the wikiRoot URL to reflect the relocated saved document bundle.Problem is the url provided in override func write(to url: URL, ofType typeName: String) throws Is not the real saved URL, maybe an intermediary URL while creating the bundle. For example on my system: /var/folders/c9/fhk113dd19j0vh_kv6fpfsvw0000gn/T/com.montecarlo-computing.WikiEditor/TemporaryItems/(A Document Being Saved By WikiEditor 3)/test.wikidocAnd of course the document.fileURL is nil...How am I supposed to get the real new "wiki/" URL of the saved document bundle?Any advice would be really really appreciated!Thanks and regards,Thierry
Posted
by orion98mc.
Last updated
.