I\'ve been trying to build on a Cocoa app that uses Swift and Storyboard in Xcode 6, but how can I use NSToolbar there?
In Xcode 5 and xib, you can add
This helped me for the IBOutlet solution you are looking for: https://stackoverflow.com/a/27555237/3398062
Update (explanation)
I discovered this thread because I was trying to create a Circular Progress Indicator inside the toolbar and I didn't know how to animate it from the ViewController since the IBOutlet was declared inside a custom WindowController.
Finally, I found the post that I have added above which describes how to access to IBOutlets from other classes.
In essence what I have done is the following:
Code Example:
@interface CustomWindowController : NSWindowController
@property (weak) IBOutlet NSProgressIndicator *progressIndicator;
@end
Code Example:
CustomWindowController *customWindowController = self.view.window.windowController;`
Code Example:
[customWindowController.progressIndicator startAnimation:sender];
or
[customWindowController.progressIndicator stopAnimation:sender];