get()

Description

Gets the image or document with the specified index in the buffer.

Syntax

func get(index: Int ) -> Any

Parameters

index:Int Specifies the index of an image or a document. The index is 0-based.

Return value

Any
The image or document with the specified index in the buffer. If the type of the data with the specified index is DcsImage, the method will return a DcsImage object. If it is DcsDocument, the method will return a DcsDocument object.

Remarks

If the index is not a positive value, or it equals/is larger than count, the exception DcsValueOutOfRangeException will be thrown and nil will be returned.

Example

class ViewController: UIViewController{
    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))
        view.addSubview(dcsView)
        dcsView.buffer.get(1)
    }
}
Is this page helpful?