Reputation: 31
[Description]
in my iPad App with uitabbarcontroller, each viewcontroller will have a few subclassed UI object, and on it is a UILabel with animation(transitionwithview) applied on the UILabel (e.g flashing animation using alpha of say a UIlabel). Animation works well and nothing is wrong.
[Situation]
Now, i commence switching between tabs(ViewController), (on load) subview animation on TAB1 works, then i switch to TAB2, then switch back to TAB1, UILabel stops animating.
(hierarchy = VC > Subclassed UI Object > UILabel)
[Question]
1> How can i keep that animation going when i switch back to TAB1?
2> What is the general good practice for UITabBarControllers? Do people manually dealloc ViewControllers on Tab Selection? or just wait for memory warning to handle the situation?
thank you for helping.
Upvotes: 0
Views: 496
Reputation: 3312
1: Ideally it is great that the animation stops. you dont want multiple animations running on different tabs when they are not the visible tab. The way you can handle your usecase is by restarting the animation in the
viewWillAppear
function of the viewcontroller of TAB1
2: No you should not manually dealloc. Let memory management handle that for you.
Upvotes: 1