I want to display activity indicator when user clicks on Tab Bar.
How do I do that?
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 will need to conform to the
<UITabBarDelegate>protocol to be informed when a tab is pressed and then you will need to implementThis is to give you the hook to be able to now set the activity indicator then:
If you are referring to the indicator in the title bar at the top then the code is
This is used to indicate network activity and therefore should not really be used to indicate that your app is loading if it is not using the network. This could lead to people misunderstanding what your app is doing and shutting it down if they do not expect it to connect to the network.
If you are using it to indicate network activity it is normally better to start it at the time when you start using the network and then in later method where you are informed that the network is finished with you hide it again at this point.