I know how to do the scroll itself, i just need help on how to detect a tap on the tabBar when on the screen to scroll up and when not on the screen to double tap to go to it and then another to scroll up.
Asked
Active
Viewed 420 times
1 Answers
0
You can use the Tab Bar delegate methods to recognise when the particular tab is clicked using Tab Bar delegate methods.
You have to keep an eye on which tab is currently selected and if the user presses the same tab again then scroll the table view to the top.
Follow this post for help in Tab Bar delegate:
Detect when a tab bar item is pressed (Swift)
tab bar click delegate (ObjC)
-
let me know if you need assistance. – Bista Sep 20 '16 at 05:12
-
i tried adding didselectviewcontroller but its not working, doesnt seem to get called. How should i set it up in the app delegate? – farhan Sep 20 '16 at 06:24
-
did you create `TabBarController` class and assigned it to your tab bar controller? – Bista Sep 20 '16 at 06:25
-
yes, how should i create the connection in App Delegate in Objective -c? – farhan Sep 20 '16 at 06:36
-
Can you give me an example on how to implement didSelectViewController? – farhan Sep 20 '16 at 07:13