I have a very simple CSS opacity animation that animates some text in a UIWebView when the web view loads. It works great when the body of the HTML is small and quick to render, but for larger bodies, you’ll find that the animation runs immediately when the content loads, but the UIWebView is not painted on to the view for another second or so, which means the user misses the animation completely.
So my question is, rather than have the fade animation occur on load, I want it to occur when the web view is actually drawn on to my view, and I don’t think there are any Objective-C delegate methods that are called when the web view is drawn, so I’m not sure if this can be done on the Objective-C side.
Is there anyway I can call some Javascript (this way I can add the animation manually) immediately when the the web view is actually drawn on my device, rather than when webViewDidload?
maybe you can inject your javascript after your
uiwebviewand your html content is loaded?webViewDidFinishLoadthis delegate gets called whenuiwebviewand your html dom tree created.