iOS UI debug

作者: ShawnDu | 来源:发表于2017-07-21 21:09 被阅读14次

两个手指点状态栏 唤出。
OC:

id overlayClass = NSClassFromString(@"UIDebuggingInformationOverlay");
    [overlayClass performSelector:@selector(prepareDebuggingOverlay)];
    id overlay = [overlayClass performSelector:@selector(overlay)] ;
    [overlay performSelector:@selector(toggleVisibility)];

Swift:

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

相关文章

网友评论

    本文标题:iOS UI debug

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