I've read this document. Seen this SO question (amongst others). And had a look at this tutorial. But for the life of me I cannot get my custom storyboard segue to work. I'm using the code found in this SO answer to bring on new views and their controllers.
Basically, the user is presented with 5 buttons in the initial view and clicking any one will cause another view to slide in from the left. All works fine, any NSButtons
that are placed on the new views receive clicks and do what they're supposed to. However, text fields are completely unaccessible: you can select any text within but not overwrite.
I'm assuming that I haven't injected the new view/view controler into the responder chain correctly (but then why do the buttons work and the text fields not?).
Judicious use of
self.resignFirstResponder()
and
newViewController.becomeFirstResponder()
always return true. I've placed them in the various initial lifecycle functions of the new views as well as in the actual custom NSViewControllerPresentationAnimator
at the end of the animation.
If the segue is a preset sheet, modal, popover or whatever then the new view receives all actions/typing just fine. So it's definitely my code.
I know it's not good form but I'm going mad: can someone please provide a step by step example using Swift?
[EDIT] Arghhhh! It seems to be that because I had the 'Title Bar' unchecked on my app window then it refused to take first responder. Shame, I quite liked the clean window with no title look....