onSingleTap

Description

Single click event. It is fired when an image with a specified index in the image gallery view is clicked.

Syntax

delegate func onSingleTap(sender:Any, index:Int)

Parameters

sender:Any The current UIImageGalleryView object that triggers the event.
index:Int The index of an image.

Return value

void

Remarks

The built-in single tap event includes toggling beween the view mode DIVME_MULTIPLE and DIVME_SINGLE, and selecting/deselecting an image under the view mode DIVME_MULTIPLE.

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(_ selectedIndice: [Any]!){
        print("Select index changed:\(selectedIndice!)")
    }
}
Is this page helpful?