I\'m using the functions below to resize my images width & height but I noticed that it ruins the image quality.
class func imageWithSize(image: UIImage,
Here is my code in swift. For squared images, it works really well and without any loss of quality!
extension UIImage { func resize(targetSize: CGSize) -> UIImage { return UIGraphicsImageRenderer(size:targetSize).image { _ in self.draw(in: CGRect(origin: .zero, size: targetSize)) } } }