在 AppDelegate 的 didFinishLaunchingWithOptions 方法中加入两行代码即可:
OC:
Class overlayClass = NSClassFromString(@"UIDebuggingInformationOverlay");
[overlayClass performSelector:NSSelectorFromString(@"prepareDebuggingOverlay")];
SWIFT:
let overlayClass = NSClassFromString("UIDebuggingInformationOverlay") as? UIWindow.Type
_ = overlayClass?.perform(NSSelectorFromString("prepareDebuggingOverlay"))
运行程序后,两根手指点击状态栏即可调起这个调试的悬浮层.
image.png想试试的小伙伴,赶紧去玩玩吧,有什么新发现告诉我哦!
网友评论