3 ms·
So basically we stop using graphics and start using code (UIViews) to draw the images. Does it do caching? A quick search for cache didn't turn up anything. If
by angerman 15y ago
So basically we stop using graphics and start using code (UIViews) to draw the images.
Does it do caching? A quick search for cache didn't turn up anything. If we have learned anything from using UITableViews with custom UITableViewCells then it is that drawing is expensive.
The underlying idea of generating your images "programmatically" is not a bad one to start but performance wise, if the image (View) is going to be static, rendering into a bitmap and using that subsequently is the more performant solution.
Maybe the tool we are looking for is not one that generates UIViews but let's us just get the images correctly name and at the right resolutions with a click? Like automatic slicing and exporting at predefined resolutions with predefined naming schemes. I just think this would better be done off the device.
For interactive views (drag, move, ...), where redrawing is necessary, this could be a valuable tool -- if it can do that.
- irrationalfab 15y agoYou have the option to save a Core Graphics generated UIImage to NSCache or even to the temp folder.
- gdubs 15y agoWhen a uiview renders, it does so to a layer. Calayer caches its bitmap content. So, moving something on screen doesn't require redrawing. Most implicitly animated properties (opacity, transforms, etc) won't require a redraw. As mentioned below, it's fairly trivial to save a context to a png file if you must.