PDFGenerator
PDFGenerator copied to clipboard
Unable to show Symbol Image correctly (Bug)
trafficstars
If there is a Symbol image, the result is incorrect. The image will appear as a color covering its entire frame.
Example:
let imgA = UIImage(systemName: "swift")!
My solution is to transform it to a regular image using this code:
extension UIImage {
/// Convert any image (e.g symbol image) to regular image
var regularImage: UIImage {
return UIGraphicsImageRenderer(size: size).image { _ in
draw(in: CGRect(origin: .zero, size: size))
}
}
}
Usage:
let imgA = UIImage(systemName: "swift")!
let imgB = imgA.regularImage