Xcode supported inclusion of PDF files for quite a while now. first it was done by converting them into png images at build time, lately you would be able setting "Preserve Vector Data" in the asset catalogue's image so that would keep vector images "vector" all until rendering.
but how that's actually done internally? i don't seem able to use UIImage(data: pdfFileData) to build images from pdfs. i can use UIGraphicsImageRenderer based code or another code that creates CGContext of a needed size and draws PDF into it, but i wonder how system does this?
any code that i can think of requires creating bitmap context of a particular size (in pixels) and rendering into it, which loses the "vectorness" of the image (ability to scale nicely).
so the question is, if my image assets are not available at build time (and i am not able including them into an asset catalogue, but have them as a Data instances at runtime) what is the way to mimic the system behaviour of creating vector-preserved UIImage's out of pdfs?
but how that's actually done internally? i don't seem able to use UIImage(data: pdfFileData) to build images from pdfs. i can use UIGraphicsImageRenderer based code or another code that creates CGContext of a needed size and draws PDF into it, but i wonder how system does this?
any code that i can think of requires creating bitmap context of a particular size (in pixels) and rendering into it, which loses the "vectorness" of the image (ability to scale nicely).
so the question is, if my image assets are not available at build time (and i am not able including them into an asset catalogue, but have them as a Data instances at runtime) what is the way to mimic the system behaviour of creating vector-preserved UIImage's out of pdfs?