Vector art on iOS

We now have 4 permissions to support, and my application needs at least 6 full-screen background images. Do not want to break the bank into megabytes of images.

I see guides on the Internet about downloading PDF files as images and custom SVG libraries, but do not discuss prectically.

Here's the question: considering the rendering speed and file size, what is the way to bet on using vector images in iOS? And besides, are there any practical caches or other considerations that need to be made in application development in the real world?

+4
source share
1 answer

Something that needs to be considered for simple graphics, such as the type of thing used for the background, etc., is just to render them at runtime using CG.

For example, in one of our applications, instead of including a typical repeating tile background image in all the necessary resolutions, we instead draw it once in CGPatternRef and then convert it to UIColor, after which everything becomes simple.

We still use image files for complex things, but for everything that is just in nature, we just visualize it at runtime and cache the result, so we get resolution independence without copying image files. It also simplified maintenance.

+2
source

Source: https://habr.com/ru/post/1403312/


All Articles