I've a NSDocument and it saves and read some data. I'd like to use these data in my ViewController. How can I access it? I haven't found any information about doing this in swift, only in obj-c but when I translated it into swift it always fails.
More precisely:
I have a dictionary(my property of Document) which stores all data - I save from this dictionary and read to it. And I'd like to access this property(dictionary) from ViewController.
Asked
Active
Viewed 562 times
2
-
1Why not stick to Objective-C then? You can use Objective-C side by side with Swift in one project. – Joride Feb 02 '16 at 19:19
-
I'm not sure if I would be able to do it – Gun13 Feb 02 '16 at 19:22
1 Answers
2
I found a solution:
(self.view.window?.windowController?.document as! Document).arch.objectForKey("saved")
And what is important - call it in viewWillAppear!

Gun13
- 103
- 9