I have a NSTextField in a sheet and it is not editable.
This bug seems known in Cocoa, see: can't edit NSTextField in sheet at runtime
But I am looking for a solution in pure Swift. I've tried this:
extension NSWindow {
override var canBecomeKey:Bool {
get {
return true;
}
}
}
But it seems like we can't override class properties. Then I tried setting a title to the window, or calling makeKey() and becomeKey() on the sheet main ViewController's viewDidAppear function, setting a title and title visibility did not helped either...
Edit: Here's the code I use for creating the sheet:
@IBAction func addDataSourceAction(_ sender: Any) {
let sheetController = NSStoryboard.init(name: "MyStoryboard", bundle: nil).instantiateController(withIdentifier: "MyPageController") as! NSPageController
presentViewControllerAsSheet(sheetController)
}