I want to do something similar to the code below, where it shows an alert when a user taps a navigation bar item button. However the code below doesn\'t work, the alerts do