美文网首页
ios自带调试悬浮窗

ios自带调试悬浮窗

作者: 伏特加 | 来源:发表于2017-05-30 11:05 被阅读260次

    写入入口类内即可.两个指头点击statusbar触发
    oc:

    #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")];
        });
    #endif
    

    swift:

    let overlayClass = NSClassFromString("UIDebuggingInformationOverlay") as? UIWindow.Type
    _ = overlayClass?.perform(NSSelectorFromString("prepareDebuggingOverlay"))
    

    具体使用方法见链接:
    http://swift.gg/2017/05/27/ui-debugging-information-overlay/

    相关文章

      网友评论

          本文标题:ios自带调试悬浮窗

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