display images and movies in a View in SwiftUI
Budget: $10 – $30 USD
Hi,
I am trying to upload selected images and video to a server. Before I do that, i need to display all selected item in an array to a view.
func picker(_ picker: PHPickerViewController, didFinishPicking results: [PHPickerResult]) {
if results.isEmpty {
parent.isPresented = false
}
else {
for item in results {
item.itemProvider.loadFileRepresentation(forTypeIdentifier: "public.item") { [weak self] (url, error) in
if error != nil {
print("error \(error!)");
} else {
if let url = url {
self?.parent.selectedPath.append(url)
}
}
}
self.parent.isPresented = false
}
I am trying to upload selected images and video to a server. Before I do that, i need to display all selected item in an array to a view.
func picker(_ picker: PHPickerViewController, didFinishPicking results: [PHPickerResult]) {
if results.isEmpty {
parent.isPresented = false
}
else {
for item in results {
item.itemProvider.loadFileRepresentation(forTypeIdentifier: "public.item") { [weak self] (url, error) in
if error != nil {
print("error \(error!)");
} else {
if let url = url {
self?.parent.selectedPath.append(url)
}
}
}
self.parent.isPresented = false
}
Related categories:
Swift