Benefits of basic graphics:
- The code for drawing the button is likely to be smaller than the image file.
- Allows dynamic change, small changes without adding a full second image.
- As you mentioned, permission is not dependent.
- Less memory (does not allocate memory to store each pixel).
Pluses of images:
- Creating an image in an editor will usually be easier than writing code that draws great. (If you use anything other than solid colors, it could be a lot easier.)
- The editor will allow you to see the image in advance without recompiling.
- Itβs easier to work with other built-in objects (i.e. you can do this with a UIButton background).
As for work time, I'm not sure. I would suggest that CG will be faster for simple drawing, where most of the pixels will not be changed, but images will be faster for more complex drawing, where most of the pixels will be changed (Assuming you use PNG format, so it becomes wholesale Otherwise CG will probably always be faster).
As a compromise, you can draw the image once and use this image for future drawing. This will allow you to get some benefits from each.
source share