I want to make a UIBarButtonItem that changes title by tap.
I thought that this was nice and very easy but... I don't understand why action doesn't run.
You should be printing right away after entering the function. (what if the 'if' statement fails? You would still be wondering whether the function is called at all).
It is hard to tell what the problem is while everything's done in the interface builder and can't be properly shared as code. Please take some time to search for how to wire up your bar button to an @IBAction and make sure it is called. The rest will be easier.
will change the action. An @IBAction is nothing more than a way to specify a #selector through your storyboard, and a UIBarButtonItem obviously can't have more than one action (there is only one action). Move everything to a single function that would both check for the title and do what's in revealToggle(_:). By the way, the sender is the object that sends the action (menu), use it.