只需用两根手指向下滑动即可显示具有可自定义按钮的调试栏。
示例
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
#if DEBUG
[[KRDebugBar sharedInstance] setup];
[[KRDebugBar sharedInstance] addButtonWithTitle:@"Action 1" action:^{
NSLog(@"Pressed action 1");
}];
[[KRDebugBar sharedInstance] addButtonWithTitle:@"Action 2" action:^{
NSLog(@"Pressed action 2");
}];
[[KRDebugBar sharedInstance] addButtonWithTitle:@"Action 3" action:^{
NSLog(@"Pressed action 3");
}];
[[KRDebugBar sharedInstance] addButtonWithTitle:@"Action 4" action:^{
NSLog(@"Pressed action 4");
}];
[[KRDebugBar sharedInstance] addButtonWithTitle:@"Action 5" action:^{
NSLog(@"Pressed action 5");
}];
#endif
return YES;
}