Skip to content

Instantly share code, notes, and snippets.

@joshavant
Created July 9, 2013 01:36
Show Gist options
  • Select an option

  • Save joshavant/5953975 to your computer and use it in GitHub Desktop.

Select an option

Save joshavant/5953975 to your computer and use it in GitHub Desktop.
Quick debug button for iOS apps

Copy-and-paste this over the last few lines of application:didFinishLaunchingWithOptions:

  UIButton *debugButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
  debugButton.frame = CGRectMake(0.f, 20.f, 44.f, 44.f);
  [debugButton addTarget:self action:@selector(didPressDebugButton) forControlEvents:UIControlEventTouchUpInside];
  [self.window addSubview:debugButton];

  return YES;  
}

- (void)didPressDebugButton
{
  NSLog(@"boink!");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment