Sunday, December 15, 2024
HomeiOS Developmentios - SDWebImage doesn't load SVG picture appropriately when it accommodates textual...

ios – SDWebImage doesn’t load SVG picture appropriately when it accommodates textual content labels


That is my easy extension for UIImageView:

import SDWebImage
import UIKit

extension UIImageView {

    func setImage(
        with url: URL,
        defaultImage: UIImage? = nil,
        completion: ImageHandler? = nil
    ) {
        downloadImage(with: url) { [weak self] picture in
            self?.picture = picture?.grayScale
            completion?(picture)
        }
    }

    func downloadImage(with url: URL, completion: @escaping ImageHandler) {
            sd_setImage(
                with: url,
                placeholderImage: nil,
                choices: [.allowInvalidSSLCertificates, .avoidAutoSetImage, .transformVectorImage],
                context: nil,
                progress: nil
            ) { picture, _, _, _ in
                completion(picture)
            }
    }
}

And the lead to my ios app is the next:

enter image description here

All fonts and its sizes are fallacious. They’re too small. It ought to look fairly like this:

enter image description here

What do I do?

I merely set url to my UIImageView:

cardPreview.aversImageView.setImage(with: url)

Right here is the fashion of my SVG file:


RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments