Skip to content

Instantly share code, notes, and snippets.

@waynehartman
Created January 20, 2013 04:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save waynehartman/4576715 to your computer and use it in GitHub Desktop.
Save waynehartman/4576715 to your computer and use it in GitHub Desktop.
//
// UISwitch+ForChrisLowe.h
//
// Created by Wayne on 1/19/13.
// Copyright (c) 2013 WayneHartman. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UISwitch (ForChrisLowe)
+ (id)switchWithTarget:(id)target action:(SEL)action forControlEvent:(UIControlEvents)controlEvents;
@end
//
// UISwitch+ForChrisLowe.m
//
// Created by Wayne on 1/19/13.
// Copyright (c) 2013 WayneHartman. All rights reserved.
//
#import "UISwitch+ForChrisLowe.h"
@implementation UISwitch (ForChrisLowe)
+ (id)switchWithTarget:(id)target action:(SEL)action forControlEvent:(UIControlEvents)controlEvents {
UISwitch *swidge = [[UISwitch alloc] initWithFrame:CGRectZero];
[swidge addTarget:target action:action forControlEvents:controlEvents];
return swidge;
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment