An advanced Ethereum/EVM mobile wallet
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
alpha-wallet-ios/AlphaWallet/Extensions/UIImageView+Extension.swift

28 lines
646 B

//
// UIImageView+Extension.swift
// AlphaWallet
//
// Created by Vladyslav Shepitko on 17.11.2021.
//
import Foundation
import Kingfisher
extension UIImageView {
func setImage(url urlValue: URL?, placeholder: UIImage? = .none) {
if let url = urlValue {
let resource = ImageResource(downloadURL: url)
var options: KingfisherOptionsInfo = []
if let value = placeholder {
options.append(.onFailureImage(value))
}
kf.setImage(with: resource, placeholder: placeholder, options: options)
} else {
image = placeholder
}
}
}