Reputation: 7466
The question might seem confusing so let me clarify.
I am working on a very heavily content driven app. Content is obtained asynchronously and there are often dozen or more elements on screen that represent content. Images, text...etc...all these are implemented via UIView subclasses.
I'd like to be able to set per app level (via appearance proxy or some other method), that once the view is ready for being rendered visible, it should fade in instead of just show up suddenly after the next render pass.
Anybody any ideas? Is there some CALayer property that would allow this easily? Drawrect? Override hidden? A convenience public wrapper function using UIView animations internally?
Once again, I know how to do this on individual level using UIView animations methods. What I want is a global change of behaviour for all UIViews.
Upvotes: 0
Views: 51
Reputation: 13903
This isn't something that can be done via appearance proxies, but you can subclass UIView
and override its method (or create an extension with a new method) addSubview()
method to perform the animation.
Upvotes: 0
Reputation: 1920
You can create a UIView subclass with a property readyForRendering and do the fade-in animation (which you already know how) when it is set to true. Make your existing UIView subclasses subclass of this new UIView subclass and set readyForRendering as needed.
Upvotes: 0