ارفع راسك فوق انته سوري حر ... :green_heart::green_heart:

Skip to content
Snippets Groups Projects
Commit dc60c57e authored by Mustafa Merza's avatar Mustafa Merza
Browse files

- Added compressing images when saved.

parent 1d01eaaf
Branches
No related tags found
No related merge requests found
......@@ -10,8 +10,12 @@ import Foundation
import UIKit
extension URL {
func saveImage(image: UIImage?) -> URL? {
if let jpgRepresentation = image?.jpegData(compressionQuality: 1.0) {
if let image: UIImage = image?.wxCompress(),
let jpgRepresentation = image.jpegData(compressionQuality: 1.0) {
do {
try jpgRepresentation.write(to: self,
options: .atomic)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment