0

I am working on an app which has lot of images and graphics. There are instances where I need to re-use the icons, images etc to change color using the image rendering capability of Xcode. Inspite all of my best efforts the size of my app huge. I also looked into the PaintCode approach to move the icon images from assets to code. But I am wondering will it be good idea to move the efforts from compile time to run time? Will it not burden the app too mutch and affect the application's performance? With PaintCode gaining reputation in the market I am sure this would have been discussed somewhere.

Tricertops
  • 8,492
  • 1
  • 39
  • 41
SHN
  • 785
  • 7
  • 23

2 Answers2

2

I use a PaintCode approach in my project and performance is good. But I don't have many icons on the screen and do not draw many images at the same time. You could improve performance if needed using cache for generated images (Don't forget to clean it when didReceiveMemoryWarning calls).

If you have many images which depends of screen resolution you could also try to use.

Andrew Bogaevskyi
  • 2,251
  • 21
  • 25
  • Thanks for your views @Andrew Bogaevskyi. Will you also be able to comment on the point that performance wise which approach is better loading an image from bundle or creating that image from code(like paintCode). This way it will be clear if choosing complete PaintCode approach is better or not? – SHN Aug 03 '16 at 15:06
  • I'm using PaintCode approach basically for images which are change color. Other images I use from asset catalog. So I can't be fully confident that use this approach for all image assets will give a good performance in your case. But I think it will work good. Especially if you will use cache. – Andrew Bogaevskyi Aug 04 '16 at 07:16
0

It's not an either-or thing. You can generate an image in code and then save it for later use. (For example, you could generate it and save the resulting image to disk, where it will take up no app memory unless and until it is actually needed.)

matt
  • 515,959
  • 87
  • 875
  • 1,141
  • However, I strongly doubt that your images have anything to do with the size of your app. You should examine the built app and find out. For example, when submitting an app to the App Store, the size is mostly due to bitcode, not to enclosed resources. – matt Aug 03 '16 at 21:47