Skip to content

Instantly share code, notes, and snippets.

@jontelang
Created May 5, 2013 09:39
Show Gist options
  • Save jontelang/5520315 to your computer and use it in GitHub Desktop.
Save jontelang/5520315 to your computer and use it in GitHub Desktop.
toggle
-(void)setToggle:(BOOL)arg
{
...
[toggleButton removeFromSuperview];
toggleButton = Nil;
if(arg)
{
...
toggleButton = [[UIView alloc] initWithFrame:CGRectMake(295,0,25,25)];
UITapGestureRecognizer* tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(togglePiano:)];
[toggleButton addGestureRecognizer:tap];
toggleButton.backgroundColor = [UIColor clearColor];
[self addSubview:toggleButton];
[tap release];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment