blockchainethereumblockchain-walleterc20erc721walletxdaidappdecentralizederc1155erc875iosswifttokens
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.
28 lines
646 B
28 lines
646 B
3 years ago
|
//
|
||
|
// 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
|
||
|
}
|
||
|
}
|
||
|
}
|