Skip to content

Instantly share code, notes, and snippets.

@wethu
Last active August 29, 2015 14:14
Show Gist options
  • Select an option

  • Save wethu/3e431c6ede936968cc7d to your computer and use it in GitHub Desktop.

Select an option

Save wethu/3e431c6ede936968cc7d to your computer and use it in GitHub Desktop.
#import <UIKit/UIKit.h>
@interface CPControlSwitch : UISwitch {
BOOL _switchState;
}
- (void)setSwitchState:(BOOL)switchState;
- (BOOL)isSwitchState;
@end
@implementation MySwitch
- (void)setSwitchState:(BOOL)switchState {
self.on = switchState;
_switchState = switchState;
}
- (BOOL)isSwitchState {
return _switchState;
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment