1 like
·
4.5K reads
3 comments
Hey Xavier! Good stuff, thanks for the article.
I was wondering, how would you handle uploading a local file and having it immediately reflect in the UI? Because the Image views use instances of ImageLoader to load the image, which makes it hard to access those instances and change the image.
Let's say I have photosPicker, from where I get the image data from PhotosPickerItem for a newly uploaded image. But I can't wrap my head around how I'd get that new data into the ImageLoader instances that are already being used (and now with the old, outdated image) in my views.
I used fileImporter and got local URL to image then I am getting data for URL like the following
let _ = fileUrl.startAccessingSecurityScopedResource() let file = try Data(contentsOf: fileUrl) fileUrl.stopAccessingSecurityScopedResource()
then I am uploading the data to my server and getting URL and displaying that in my ImageView
if that helps
Loved this implementation. Simple concept that is easy to integrate without having to add a lot of code.