swap()

Description

Switches the places for two images or documents.

Syntax

- (void) swap: (NSInteger) firstIndex
second: (NSInteger) secondIndex

Parameters

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

Return value

Void

Exceptions

Circumstance Exception thrown
firstIndex >= count or secondIndex >= count or firstIndex < 0 or secondIndex < 0 DcsValueOutOfRangeException

Example


@interface ViewController () {
    DcsView *dcsView;
}
@end
 
@implementation ViewController
 
- (void)viewDidLoad {
    [super viewDidLoad];
     
    dcsView = [[DcsView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
 
    [self.view addSubview:dcsView];

    [self.dcsView.buffer swap:0 second:1];
}

@end

Is this page helpful?

Leave a Reply

Your email address will not be published.