Created
January 13, 2017 17:52
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Cocoa | |
@NSApplicationMain | |
class AppDelegate: NSObject, NSApplicationDelegate { | |
@IBOutlet weak var window: NSWindow! | |
@IBOutlet var objectController: NSObjectController! | |
dynamic var foo: String = "" { | |
didSet { print("did set foo to \(self.foo)") } | |
} | |
@IBAction func saveOrSomething(_ sender: Any) { | |
self.objectController.commitEditing() | |
print("as this is clicked, foo is '\(self.foo)'") | |
// presumably, do something to save the data | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment