vector images in iOS using xcassets
Its been a tough job to get multiple images for each resolution and also we never know when next 4x images might come in, to make app compatible for all devices we can use vector images in xcassets, which only impacts compile time and not at runtime. These pdfs are changed into png files during compile time. Also you can use the same asset and change its tint color to re-use it.
Using vector image
Step 1: get vector image and convert it to pdf file.
Step 2: In your project add “New Image Set” and in inspector
- set Scale as “Single Scale”
- set Render As “default”
Step 3: use it as you normally use an asset
Changing color of vector image
Step 1: In your project add “New Image Set” and in inspector
— set Scale as “Single Scale”
— set Render As “TemplateImage”
Step 2: use it as you normally use an asset
Step 3: change its tint color
Github sample project link:
Read More:
https://medium.com/@ankitkumargupta/xcode-how-to-symbolicate-a-crash-text-file-650a1b09ec79