Reputation: 434
I want to access a variable from my AppDelegate Class in my other class
class AppDelegate: NSObject, NSApplicationDelegate
class Other: NSView
I tried AppDelegate.variable but it doesn't work
Upvotes: 0
Views: 57
Reputation: 5258
You need to do this: let appDelegate = UIApplication.sharedApplication().delegate as! AppDelegate
and then you can access its member variables.
Upvotes: 2