What is the best way to store and read Image with Swift?

Ali Ihsan URAL Source

I write a small chat app and want to store image to phone. Now I store the images to document directory but i want to do like whatsapp. Image is stored in Photo Library and read from there. How can I do this?

My Code is ..

let documentsDirectory = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first!
let fileName = "\(imageUid!).jpeg"
let fileURL = documentsDirectory.appendingPathComponent(fileName)


comments powered by Disqus