Obtaining a View Controller Reference
问题 I read quite a few questions and answers no this problem. Some are for Ojective C. Some are for iOS. The ones that were close to what I need didn't work. I've set up a protocol for delegation. It doesn't work. The problem is that delegate variable isn't set. I need the reference to an active controller. Delegator protocol SwitchTabDelegate: class { func selectTab(tab: Int) } class ViewController: NSViewController { weak var delegate: SwitchTabDelegate? override func viewDidLoad() { super