You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
for example, i'm selecting three images, then i click next. when i go back the images i've pre-selected are still selected, so that's good. however when i click next again the three images get appended to my images array twice, so i end up having two of the same images. same if i go back and click next again, i'll have three of the same images. am i supposed to do something additional? i'm using an if to check if the array contains the same image, but i don't think that's doing anything, so maybe i'm checking the wrong thing?
`picker.didFinishPicking { [unowned picker] items, cancelled in
for item in items {
switch item {
case .photo(let photo):
if !selectedImages.contains(photo.image) {
selectedImages.append(photo.image)
}
case .video(let video):
if !videoURLs.contains(video.url) {
videoURLs.append(video.url)
}
print(video.url)
}
self.preselectedItems.append(item)
}
createPostViewModel.showPostPage = true
if cancelled {
picker.dismiss(animated: true, completion: nil)
createPostViewModel.showPostPage = false
}
}
return picker`
The text was updated successfully, but these errors were encountered:
for example, i'm selecting three images, then i click next. when i go back the images i've pre-selected are still selected, so that's good. however when i click next again the three images get appended to my images array twice, so i end up having two of the same images. same if i go back and click next again, i'll have three of the same images. am i supposed to do something additional? i'm using an if to check if the array contains the same image, but i don't think that's doing anything, so maybe i'm checking the wrong thing?
The text was updated successfully, but these errors were encountered: