2

I am trying to recreate the behaviour in Instagram app. When a user has multiple Instagram accounts, the settings tab becomes the current users profile picture. (attached)Settings icon becomes profile picture

When a user long presses on the settings tab item it produces a pop up view to change accounts. Its important to specify that this long press gesture is triggered even if I am not on the settings tab. This makes it easy to switch accounts from anywhere in the app. Here is the attached photo

change account view

I would like to produce the same behaviour for the tab bar item. I have already created the swapping account transition. I just dont know how to add a gesture recognizer to a bar button item, can anyone help?

Jeremy Sh
  • 609
  • 7
  • 24
  • Have you tried the Long-Press gesture element? https://www.ioscreator.com/tutorials/detecting-long-press-gestures-tutorial-ios8-swift – J Manuel Dec 06 '16 at 21:31
  • How can you add a long press gesture element programmatically? @JuanCurti – Jeremy Sh Dec 06 '16 at 21:34

0 Answers0