Currently, an NSButton
reveals the Settings view, since implementing widgetDidBeginEditing()
was giving me issues.
The NSButton
calls this method:
@IBAction func clickSettings(sender: NSButton) {
if settingsViewController == nil {
settingsViewController = SettingsViewController.init(nibName: "SettingsViewController", bundle: NSBundle.mainBundle())
}
presentViewControllerInWidget(settingsViewController)
}
And this is the current implementation of widgetDidBeginEditing()
(yes, I have also tried adding the nil
check to no avail):
func widgetDidBeginEditing() {
print("began editing")
// This causes the view to flash back and forth
// presentViewControllerInWidget(settingsViewController)
}
As you can see from the comments, this implementation makes the widget very glitchy, and the Console prints "began editing” and then "ended editing" (widgetDidEndEditing()
prints "ended editing") in an infinite loop.
widgetAllowsEditing
currently returns false
, which disables editing mode until this is figured out.
Replace the NSButton
with the correct implementation of widgetDidBeginEditing()
.