SXSwitch

type:
extension
author:
Malcolm
description:
A simple switch similar to UISwitch
lastupdate:
2011-04-11
compatible:
v1.1
tag:
uiswitch, switch, toggle
homepage:
https://gist.github.com/915041
download:
https://gist.github.com/gists/915041/download

Usage

- (id)initWithWidth:(float)width height:(float)height {
    self = [super initWithWidth:width height:height];	
	sxSwitch = [[SXSwitch alloc] init];
	[sxSwitch addEventListener:@selector(onValueChange:) atObject:self forType:SX_SWITCH_EVENT_CHANGED];
	[self addChild:sxSwitch];
    return self;
}
 
- (void)onValueChange:(SPEvent*)event{
	NSLog(@"slider val: %@", (sxSwitch.on)?@"true":@"false");
}

Changelog

  • 2011/04/12 08:25: First public version

Source Code

Discussion

No comments so far. Feel free to edit this part of the page.

  extensions/sx_switch.txt · Last modified: 2015/09/14 11:14 (external edit)
 
Powered by DokuWiki