0

I have a macOS app with Toolbar where I would like to connect two buttons to Undo and Redo.

I connected the first in Storyboard with no problem by control-dragging the toolbar item to the First Responder icon in the window and choosing the -Undo action.

When trying to connect the second toolbar item, I noticed that the Redo item is not present in the list.

enter image description here

Cue
  • 2,952
  • 3
  • 33
  • 54

1 Answers1

0

Thank you to the comment by Ssswift, I solved the problem by converting in Swift the Objective-C answer to the similar question: FirstResponder missing redo:

I put this somewhere in the file (at file scope):

extension NSResponder {
    @IBAction func redo(_ sender: Any) {
    }
}

Then the redo appeared in connection list and I got the possibility to connect the toolbar item to redo.

Finally I deleted the code as suggested in the answer and all worked fine.

Cue
  • 2,952
  • 3
  • 33
  • 54