ios自带调试悬浮窗

写入入口类内即可.两个指头点击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自带调试悬浮窗)