onSelectChanged

Description

The event is fired when the indices of the seleceted images or documents in DcsBuffer are changed. It returns the indices of the selected images or documents in DcsBuffer after the change.

Syntax

delegate func onSelectChanged(sender: Any, selectedIndices:[Any])

Parameters

sender:Any The current UIImageGalleryView object that triggers the event.
indices:[Any] The indices of selected images or documents.

Return value

Void

Example

class ViewController: UIViewController,DcsUIImageGalleryViewDelegate{
    var dcsView:DcsView!
    override func viewDidLoad() {
        super.viewDidLoad()
        dcsView = DcsView(frame: CGRect(x:0,y:0,width:self.view.frame.size.width,height:self.view.frame.size.height))
        dcsView.imageGalleryView.delegate = self
        view.addSubview(dcsView)
    }
    func onSingleTap(_ sender: Any!, index: Int){
        print("SingleTap fired at index:\(index)")
    }
    func onLongPress(_ sender: Any!, index: Int){
        print("LongPress fired at index:\(index)")
    }
    func onSelectChanged(_ selectedIndices: [Any]!){
        print("Select index changed:\(selectedIndice!)")
    }
}
Is this page helpful?