I've got an array of image URLs (all from storage, not internet). How can I show the images themselves? Simplified code:
@Binding var files:[URL]//Array of image URLs taken from an NSOpenPanel instance Form{ if files.count>0{ Image(files[0].path)//Problem } }
You say NSOpenPanel, so I'm making going to make the assumption here that we don't need to worry about waiting to load the image over a network:
NSOpenPanel
if let nsImage = NSImage(contentsOf: url) { Image(nsImage: nsImage) }
2.1m questions
2.1m answers
60 comments
57.0k users