Search code examples
objective-cswiftxcodeuinavigationcontrollerios14

How to Implement Long Press back Button Navigation Pop to respective controller in the navigation stack when navigation bar is hidden


In my Project, I have kept the navigation bar hidden, starting from my root navigation controller. I have created a custom header view (which consists of one back button and title)in all my controllers which are being pushed to the navigation stack. How can I achieve long press back button navigation stack pop to any controller in the stack feature (ios 14 onwards )enter image description here


Solution

  • I tried all possible ways but no luck. So I tried with UIMenu and add it to my button it helped. you can check this link which might help to achieve the above feature by adding UIMenu on UIButton UIMenu In Action