How to delete selected images

You might have noticed that we have a method delete() in DcsBuffer, which can be used to delete an image with the specified index. The property selectedIndices stores the indices of the currently selected images or documents. Using them, you should be able to delete all the selected images.

Below is the code snippet for your reference.

    while (dcsView.imageGalleryView.selectedIndices.count >0) {
      
        
        [dcsView.buffer delete:[dcsView.imageGalleryView.selectedIndices[0] intValue]];
    }
while dcsView.imageGalleryView.selectedIndices.count>0 {

                dcsView.buffer.delete(self.dcsView.imageGalleryView.selectedIndices[0] as! Int)
}
Is this page helpful?