Open HassanTaleb90 opened 12 months ago
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
If there is a Symbol image, the result is incorrect. The image will appear as a color covering its entire frame.
Example:
My solution is to transform it to a regular image using this code:
Usage: