I am trying to pass a trigger between two view controllers, but I can not find something that works ...
I have a main controller with an NSTableView associated with the source, Base Base.
controller main class:
class ViewController: NSViewController {
I have an array defined in global variables. on viewDidLoad, I add 2 elements to my array, then I use setDelegate and setDataSource. It works great.
myLib.myCoins = fillCoinsTable() print ("My lib has \(myLib.myCoins.count) objects ") mainCoinTable.setDelegate(self) mainCoinTable.setDataSource(self)
I have a segue from WINDOWS CONTROLLER on my second controller. (This is the ToolBar button). Segue is a sheet type.
This second controller allows me to add an item to my global variable arrays using the "Save" button.
Second Controller Code
@IBAction func addCoinButton(sender: AnyObject) {
If I add a button on the main controller to reload Data in the TableView, it works fine. The third item has been added.
but I would like it to be automatic ....
I tried segue, but mine is not between the view controller, but with the Windows controller.
Can you help?
Thanks Nicolas
source share