I would add a template image at a button to change its color runtime.
I used Preview to draw and save it as a pdf.
But it is rendered only as a uniform square color (which color I can change runtimne).
How can I obtain the template pdf image?
Why the pdf saved by Preview is not working?
Yes, I want a template, a black and white image which color can be changed using setTitleColor(_ color: UIColor?, for state: UIControl.State).
I tested QuinceyMorris case 1, loading the pdf provided by Apple in https://developer.apple.com/go/?id=app-dev-swift-student-swift-4 and setting in Interface Builder "Render As" Template Image". It works.
If I change the pdf I obtain a square completely filled with the color desired. But a uniform square, not the image.
Thanks QuinceyMorris, the point is opacity. My pdf were without alpha channel. I modified it, using Gimp, so the white parts became transparent and it works.