I have a UITabBarController, if I push to different views from the first UITabBarItem and I tap the first UITabBar two times then the views that were pushed are popped back.
How can I simulate this exact functionality programatically?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You could implement the
tabBarController:didSelectViewController:method of yourUITabBarControllerto do this. You can manually count the number of taps on yourUITabBarin theAppDelegate, and have certain conditions in the method.For example, you could try in the .h file having an instance variable which stores the last
UIViewControllerselected, and the time it was selected. If you then check the last time theUIViewControllerwas called in same method, and it was a short enough period, then it would count as a double tap.Hope that Helps!