onLongPress

Description

Long press event. It is fired under the view mode DIVME_MULTIPLE when an image with a specified index in the image gallery view is long pressed.

Syntax

delegate func onLongPress(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 long press event includes long-pressing an image to move to another position under the Sort mode.

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?