swap()

Description

Switches the places for two images or documents.

Syntax

func swap(firstIndex:Int, secondIndex:Int)

Parameters

firstIndex:Int The index of the first image to be switched.
secondIndex:Int The index of the second image to be switched.

Return value

Void

Remarks

If firstIndex >= count or secondIndex >= count or firstIndex < 0 or secondIndex < 0, it will throw DcsValueOutOfRangeException.

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.swap(1, second: 2)
    }
}
Is this page helpful?

Leave a Reply

Your email address will not be published.