Created
February 27, 2019 09:16
-
-
Save matdziu/8e07f0ed877d7ce6707439af29f139fd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Foundation | |
| import UIKit | |
| import Kingfisher | |
| extension UIImageView { | |
| func downloaded(from url: URL, placeHolder: UIImage?) { | |
| self.kf.setImage(with: url, | |
| placeholder: placeHolder, | |
| options: [KingfisherOptionsInfoItem.cacheOriginalImage]) | |
| } | |
| func cancel() { | |
| self.kf.cancelDownloadTask() | |
| } | |
| func downloaded(from link: String, placeHolder: UIImage?) { | |
| guard let url = URL(string: link) else { return } | |
| downloaded(from: url, placeHolder: placeHolder) | |
| } | |
| func roundBorderCorners() { | |
| self.layer.borderColor = UIColor(named: Color.grey.rawValue)?.cgColor | |
| self.layer.borderWidth = 0.5 | |
| self.layer.cornerRadius = 3.0 | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment