For certain apps such as those that let you pick an app-provided image and then let the user resize and rotate them, it's helpful to keep the asset as a PDF instead of rasterized PNGs. Since the user can resize them, sometimes you will want to have different resolutions of the same image. Doing this with rasterized PNGs is both time-consuming and takes up more space. If you save them as vectors in PDF files, you can convert them into UIImage
instances at run time, with the appropriate size. Nigel Timothy Barber's UIImage-PDF lets you convert – at runtime – PDFs to UIImages
:
UIImage* img = [UIImage imageWithPDFNamed:@"some-pdf.pdf" fitSize:CGSizeMake(600, 600)];
//Do something with img
Check it out.
Your feedback is valuable: Do you want more nuggets like this? Yes or No
.
.