美文网首页
UIDebuggingInformationOverlay调试视

UIDebuggingInformationOverlay调试视

作者: 迈克学 | 来源:发表于2017-06-01 11:55 被阅读0次

原文链接

方法一 (启动直接显示)

需要写在- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

ifdef DEBUG

pragma clang diagnostic push

pragma clang diagnostic ignored "-Warc-performSelector-leaks"

id debugClass = NSClassFromString(@"UIDebuggingInformationOverlay");
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
    [debugClass performSelector:NSSelectorFromString(@"prepareDebuggingOverlay")];
});
id debugOverlayInstance = [debugClass performSelector:NSSelectorFromString(@"overlay")];
[debugOverlayInstance performSelector:NSSelectorFromString(@"toggleVisibility")];

pragma clang diagnostic pop

endif

方法二 (双指同时点击状态栏显示)#推荐#

需要写在- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

ifdef DEBUG

pragma clang diagnostic push

pragma clang diagnostic ignored "-Warc-performSelector-leaks"

//可视化调试
Class overlay = NSClassFromString(@"UIDebuggingInformationOverlay");
[[overlay class] performSelector:NSSelectorFromString(@"prepareDebuggingOverlay")];

pragma clang diagnostic pop

endif

效果

相关文章

网友评论

      本文标题:UIDebuggingInformationOverlay调试视

      本文链接:https://www.haomeiwen.com/subject/ajnsfxtx.html