├── UIDebuggingTool.xcodeproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── project.pbxproj ├── UIDebuggingTool ├── ViewController.h ├── AppDelegate.h ├── main.m ├── UIDebuggingTool │ ├── UIDebuggingTool.h │ ├── UIDebuggingInformationOverlay+Enable.m │ └── UIDebuggingTool.m ├── AppDelegate.m ├── ViewController.m ├── Info.plist ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard └── Assets.xcassets │ └── AppIcon.appiconset │ └── Contents.json ├── UIDebuggingTool.podspec ├── LICENSE ├── .gitignore └── README.md /UIDebuggingTool.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /UIDebuggingTool/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // UIDebuggingTool 4 | // 5 | // Created by whf5566 on 2017/12/6. 6 | // Copyright © 2017年 whf5566. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /UIDebuggingTool.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /UIDebuggingTool/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // UIDebuggingTool 4 | // 5 | // Created by whf5566 on 2017/12/6. 6 | // Copyright © 2017年 whf5566. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /UIDebuggingTool/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // UIDebuggingTool 4 | // 5 | // Created by whf5566 on 2017/12/6. 6 | // Copyright © 2017年 whf5566. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /UIDebuggingTool/UIDebuggingTool/UIDebuggingTool.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIDebuggingTool.h 3 | // UIDebuggingTool 4 | // 5 | // Created by whf on 2019/8/15. 6 | // Copyright © 2019 whf5566. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface UIDebuggingTool : NSObject 14 | 15 | @property (class) BOOL enableMotion; 16 | 17 | + (void)toggleVisibility; 18 | 19 | @end 20 | 21 | NS_ASSUME_NONNULL_END 22 | -------------------------------------------------------------------------------- /UIDebuggingTool/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // UIDebuggingTool 4 | // 5 | // Created by whf5566 on 2017/12/6. 6 | // Copyright © 2017年 whf5566. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 18 | return YES; 19 | } 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /UIDebuggingTool/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // UIDebuggingTool 4 | // 5 | // Created by whf5566 on 2017/12/6. 6 | // Copyright © 2017年 whf5566. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "UIDebuggingTool.h" 11 | 12 | @interface ViewController () 13 | 14 | @end 15 | 16 | @implementation ViewController 17 | 18 | - (void)viewDidLoad { 19 | [super viewDidLoad]; 20 | [self becomeFirstResponder]; 21 | } 22 | 23 | - (IBAction)onClickToggleVisibility:(id)sender { 24 | [UIDebuggingTool toggleVisibility]; 25 | } 26 | 27 | - (BOOL)canBecomeFirstResponder { 28 | return YES; 29 | } 30 | 31 | - (void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event { 32 | NSLog(@"test motion"); 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /UIDebuggingTool.podspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | Pod::Spec.new do |s| 4 | 5 | s.name = "UIDebuggingTool" 6 | s.version = "0.2.1" 7 | s.summary = "A tool to enable UIDebuggingInformationOverlay for iOS" 8 | s.description = <<-DESC 9 | A tool to help aid in visual debugging by using UIDebuggingInformationOverlay 10 | DESC 11 | s.homepage = "https://github.com/whf5566/UIDebuggingTool" 12 | s.license = "MIT" 13 | s.author = { "whf5566" => "whf5566@gamil.com" } 14 | s.social_media_url = "http://wellphone.me" 15 | 16 | s.platform = :ios, "9.0" 17 | s.source = { :git => "https://github.com/whf5566/UIDebuggingTool.git", :tag => "#{s.version}" } 18 | s.source_files = "UIDebuggingTool/UIDebuggingTool/*.{h,m}" 19 | s.public_header_files = "UIDebuggingTool/UIDebuggingTool/*.h" 20 | 21 | end 22 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /UIDebuggingTool/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xccheckout 23 | *.xcscmblueprint 24 | 25 | ## Obj-C/Swift specific 26 | *.hmap 27 | *.ipa 28 | *.dSYM.zip 29 | *.dSYM 30 | 31 | # CocoaPods 32 | # 33 | # We recommend against adding the Pods directory to your .gitignore. However 34 | # you should judge for yourself, the pros and cons are mentioned at: 35 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 36 | # 37 | # Pods/ 38 | 39 | # Carthage 40 | # 41 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 42 | # Carthage/Checkouts 43 | 44 | Carthage/Build 45 | 46 | # fastlane 47 | # 48 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 49 | # screenshots whenever they are needed. 50 | # For more information about the recommended setup visit: 51 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 52 | 53 | fastlane/report.xml 54 | fastlane/Preview.html 55 | fastlane/screenshots 56 | fastlane/test_output 57 | 58 | # Code Injection 59 | # 60 | # After new code Injection tools there's a generated folder /iOSInjectionProject 61 | # https://github.com/johnno1962/injectionforxcode 62 | 63 | iOSInjectionProject/ 64 | -------------------------------------------------------------------------------- /UIDebuggingTool/UIDebuggingTool/UIDebuggingInformationOverlay+Enable.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIDebuggingInformationOverlay+Enable.m 3 | // UIDebuggingInformationOverlay 4 | // 5 | // Created by whf5566 on 2017/12/05. 6 | // Copyright © 2017年 whf5566. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | /* 13 | In iOS 11, Apple added additional checks to disable this overlay unless the 14 | device is an internal device. To get around this, we swizzle out the 15 | -[UIDebuggingInformationOverlay init] method (which returns nil now if 16 | the device is non-internal) 17 | 18 | */ 19 | 20 | #if defined(DEBUG) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_11_0 21 | 22 | @interface UIWindow (PrivateMethods) 23 | - (void)_setWindowControlsStatusBarOrientation:(BOOL)orientation; 24 | @end 25 | 26 | @interface _FakeWindowClass : UIWindow 27 | @end 28 | 29 | @implementation _FakeWindowClass 30 | 31 | + (void)load { 32 | static dispatch_once_t onceToken; 33 | dispatch_once(&onceToken, ^{ 34 | Class UIDebuggingInformationOverlayClass = NSClassFromString(@"UIDebuggingInformationOverlay"); 35 | Method originalMethod = class_getInstanceMethod(UIDebuggingInformationOverlayClass, @selector(init)); 36 | Method swizzledMethod = class_getInstanceMethod([_FakeWindowClass class], @selector(initSwizzled)); 37 | method_exchangeImplementations(originalMethod, swizzledMethod); 38 | }); 39 | } 40 | 41 | - (instancetype)initSwizzled { 42 | self = [super init]; 43 | if (self) { 44 | [self _setWindowControlsStatusBarOrientation:NO]; 45 | } 46 | return self; 47 | } 48 | 49 | @end 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # UIDebuggingTool 2 | 3 | A tool to enable UIDebuggingInformationOverlay for iOS 10 & 11 & 12 & 13. 4 | 5 | ## Install 6 | 7 | ### copy source files 8 | 9 | - Copy UIDebuggingInformationOverlay+Enable.m, UIDebuggingTool.h, UIDebuggingTool.m to your project. 10 | 11 | ### pod 12 | 13 | ```ruby 14 | pod 'UIDebuggingTool' 15 | ``` 16 | 17 | ## Usage 18 | 19 | - Just shake your phone to show UIDebugging view. 20 | 21 | ## WARNING 22 | 23 | - It will hold the window displayed on the page of Current Window, after entering this page. ([ripperhe](https://github.com/ripperhe) reported this problem) 24 | - Workaround: 25 | 26 | 1. Pick up a system default window on the page of Current Window. 27 | 2. Go back to the page of View Hierarchy, pull down to refresh this page. 28 | 29 | ## 安装 30 | 31 | 使用pod引入 UIDebuggingInformationOverlay+Enable.m, UIDebuggingTool.h, UIDebuggingTool.m 文件 32 | 33 | ```ruby 34 | pod 'UIDebuggingTool' 35 | ``` 36 | 37 | ## 使用方法 38 | 39 | - 摇晃手机即可显示系统的UI调试界面。 40 | - 更多的使用方法见[iOS自带悬浮窗调试工具使用详解](https://wellphone.me/post/2017/use_uidebugginginformationoverlay_to_debug_ui/) 41 | 42 | ## 警告 43 | 44 | - 在进入Current Window页面后,在该页面显示的window会被该工具持有。(该问题由[ripperhe](https://github.com/ripperhe)报告) 45 | - 解决办法: 46 | 47 | 1. 在Current Window页面选择一个系统的window; 48 | 2. 返回到View Hierarchy页面,下拉刷新。 49 | 50 | ## Links 51 | 52 | - [Swizzling in iOS 11 with UIDebuggingInformationOverlay](https://www.raywenderlich.com/177890/swizzling-in-ios-11-with-uidebugginginformationoverlay) 53 | - [iOS自带悬浮窗调试工具使用详解](https://wellphone.me/post/2017/use_uidebugginginformationoverlay_to_debug_ui/) 54 | - [在iOS11上使用自带悬浮窗工具调试UI](https://wellphone.me/post/2017/use_uidebugginginformationoverlay_for_ios11) 55 | -------------------------------------------------------------------------------- /UIDebuggingTool/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /UIDebuggingTool/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /UIDebuggingTool/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /UIDebuggingTool/UIDebuggingTool/UIDebuggingTool.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIDebuggingTool.m 3 | // UIDebuggingTool 4 | // 5 | // Created by whf on 2019/8/15. 6 | // Copyright © 2019 whf5566. All rights reserved. 7 | // 8 | 9 | #import "UIDebuggingTool.h" 10 | #import 11 | 12 | #if defined(DEBUG) 13 | 14 | void SwapInstanceMethods(Class cls, SEL original, SEL replacement) { 15 | Method originalMethod = class_getInstanceMethod(cls, original); 16 | IMP originalImplementation = method_getImplementation(originalMethod); 17 | const char *originalArgTypes = method_getTypeEncoding(originalMethod); 18 | 19 | Method replacementMethod = class_getInstanceMethod(cls, replacement); 20 | IMP replacementImplementation = method_getImplementation(replacementMethod); 21 | const char *replacementArgTypes = method_getTypeEncoding(replacementMethod); 22 | 23 | if (class_addMethod(cls, original, replacementImplementation, replacementArgTypes)) { 24 | class_replaceMethod(cls, replacement, originalImplementation, originalArgTypes); 25 | } else { 26 | method_exchangeImplementations(originalMethod, replacementMethod); 27 | } 28 | } 29 | 30 | @interface _FakeGestureRecognizer : UIGestureRecognizer 31 | - (UIGestureRecognizerState)state; 32 | @end 33 | 34 | @implementation _FakeGestureRecognizer 35 | // [[UIDebuggingInformationOverlayInvokeGestureHandler mainHandler] _handleActivationGesture:(UIGestureRecognizer *)] 36 | // requires a UIGestureRecognizer, as it checks the state of it. We just fake that here. 37 | - (UIGestureRecognizerState)state { 38 | return UIGestureRecognizerStateEnded; 39 | } 40 | 41 | @end 42 | 43 | NSString *const UIEventSubtypeMotionShakeNotification = @"UIEventSubtypeMotionShakeNotification"; 44 | @implementation UIApplication (swizzle) 45 | - (void)swizzle_sendEvent:(UIEvent *)event { 46 | [self swizzle_sendEvent:event]; 47 | if (event.type == UIEventTypeMotion && event.subtype == UIEventSubtypeMotionShake) { 48 | if ([[event valueForKey:@"shakeState"] intValue] == 1) { 49 | [[NSNotificationCenter defaultCenter] postNotificationName:UIEventSubtypeMotionShakeNotification object:nil]; 50 | } 51 | } 52 | } 53 | 54 | @end 55 | 56 | #endif 57 | 58 | @implementation UIDebuggingTool 59 | #if defined(DEBUG) 60 | + (void)load { 61 | static dispatch_once_t onceToken; 62 | dispatch_once(&onceToken, ^{ 63 | SwapInstanceMethods([UIApplication class], @selector(sendEvent:), @selector(swizzle_sendEvent:)); 64 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onUIApplicationDidFinishLaunching) name:UIApplicationDidFinishLaunchingNotification object:nil]; 65 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onMotionShake) name:UIEventSubtypeMotionShakeNotification object:nil]; 66 | }); 67 | } 68 | 69 | + (void)onUIApplicationDidFinishLaunching { 70 | [self prepareDebuggingOverlay]; 71 | } 72 | 73 | + (void)onMotionShake { 74 | if (self.enableMotion) { 75 | [self toggleVisibility]; 76 | } 77 | } 78 | 79 | #endif 80 | 81 | static BOOL _enableMotion = TRUE; 82 | + (BOOL)enableMotion { 83 | return _enableMotion; 84 | } 85 | 86 | + (void)setEnableMotion:(BOOL)enableMotion { 87 | _enableMotion = enableMotion; 88 | } 89 | 90 | + (void)prepareDebuggingOverlay { 91 | #if defined(DEBUG) 92 | #pragma clang diagnostic push 93 | #pragma clang diagnostic ignored "-Warc-performSelector-leaks" 94 | id overlayClass = NSClassFromString(@"UIDebuggingInformationOverlay"); 95 | [overlayClass performSelector:NSSelectorFromString(@"prepareDebuggingOverlay")]; 96 | #pragma clang diagnostic pop 97 | #endif 98 | } 99 | 100 | + (void)toggleVisibility { 101 | #if defined(DEBUG) 102 | #pragma clang diagnostic push 103 | #pragma clang diagnostic ignored "-Warc-performSelector-leaks" 104 | if (@available(iOS 11.0, *)) { 105 | id overlayClass = NSClassFromString(@"UIDebuggingInformationOverlay"); 106 | [overlayClass performSelector:NSSelectorFromString(@"overlay")]; 107 | id handlerClass = NSClassFromString(@"UIDebuggingInformationOverlayInvokeGestureHandler"); 108 | 109 | id handler = [handlerClass performSelector:NSSelectorFromString(@"mainHandler")]; 110 | [handler performSelector:NSSelectorFromString(@"_handleActivationGesture:") withObject:[[_FakeGestureRecognizer alloc] init]]; 111 | } else { 112 | id overlayClass = NSClassFromString(@"UIDebuggingInformationOverlay"); 113 | id overlay = [overlayClass performSelector:NSSelectorFromString(@"overlay")]; 114 | [overlay performSelector:NSSelectorFromString(@"toggleVisibility")]; 115 | } 116 | #pragma clang diagnostic pop 117 | #endif 118 | } 119 | 120 | @end 121 | -------------------------------------------------------------------------------- /UIDebuggingTool.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 48; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | A6F541121FD7D93E002A3D24 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = A6F541111FD7D93E002A3D24 /* AppDelegate.m */; }; 11 | A6F541151FD7D93E002A3D24 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A6F541141FD7D93E002A3D24 /* ViewController.m */; }; 12 | A6F541181FD7D93E002A3D24 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A6F541161FD7D93E002A3D24 /* Main.storyboard */; }; 13 | A6F5411A1FD7D93E002A3D24 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A6F541191FD7D93E002A3D24 /* Assets.xcassets */; }; 14 | A6F5411D1FD7D93E002A3D24 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A6F5411B1FD7D93E002A3D24 /* LaunchScreen.storyboard */; }; 15 | A6F541201FD7D93F002A3D24 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = A6F5411F1FD7D93F002A3D24 /* main.m */; }; 16 | E273C8482305331B00A36CD8 /* UIDebuggingInformationOverlay+Enable.m in Sources */ = {isa = PBXBuildFile; fileRef = E273C8452305331B00A36CD8 /* UIDebuggingInformationOverlay+Enable.m */; }; 17 | E273C8492305331B00A36CD8 /* UIDebuggingTool.m in Sources */ = {isa = PBXBuildFile; fileRef = E273C8472305331B00A36CD8 /* UIDebuggingTool.m */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXFileReference section */ 21 | A6F5410D1FD7D93E002A3D24 /* UIDebuggingTool.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = UIDebuggingTool.app; sourceTree = BUILT_PRODUCTS_DIR; }; 22 | A6F541101FD7D93E002A3D24 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 23 | A6F541111FD7D93E002A3D24 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 24 | A6F541131FD7D93E002A3D24 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 25 | A6F541141FD7D93E002A3D24 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 26 | A6F541171FD7D93E002A3D24 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 27 | A6F541191FD7D93E002A3D24 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 28 | A6F5411C1FD7D93E002A3D24 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 29 | A6F5411E1FD7D93F002A3D24 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 30 | A6F5411F1FD7D93F002A3D24 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 31 | E273C8452305331B00A36CD8 /* UIDebuggingInformationOverlay+Enable.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIDebuggingInformationOverlay+Enable.m"; sourceTree = ""; }; 32 | E273C8462305331B00A36CD8 /* UIDebuggingTool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIDebuggingTool.h; sourceTree = ""; }; 33 | E273C8472305331B00A36CD8 /* UIDebuggingTool.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIDebuggingTool.m; sourceTree = ""; }; 34 | /* End PBXFileReference section */ 35 | 36 | /* Begin PBXFrameworksBuildPhase section */ 37 | A6F5410A1FD7D93E002A3D24 /* Frameworks */ = { 38 | isa = PBXFrameworksBuildPhase; 39 | buildActionMask = 2147483647; 40 | files = ( 41 | ); 42 | runOnlyForDeploymentPostprocessing = 0; 43 | }; 44 | /* End PBXFrameworksBuildPhase section */ 45 | 46 | /* Begin PBXGroup section */ 47 | A6F541041FD7D93E002A3D24 = { 48 | isa = PBXGroup; 49 | children = ( 50 | A6F5410F1FD7D93E002A3D24 /* UIDebuggingTool */, 51 | A6F5410E1FD7D93E002A3D24 /* Products */, 52 | ); 53 | sourceTree = ""; 54 | }; 55 | A6F5410E1FD7D93E002A3D24 /* Products */ = { 56 | isa = PBXGroup; 57 | children = ( 58 | A6F5410D1FD7D93E002A3D24 /* UIDebuggingTool.app */, 59 | ); 60 | name = Products; 61 | sourceTree = ""; 62 | }; 63 | A6F5410F1FD7D93E002A3D24 /* UIDebuggingTool */ = { 64 | isa = PBXGroup; 65 | children = ( 66 | E273C8442305331B00A36CD8 /* UIDebuggingTool */, 67 | A6F541101FD7D93E002A3D24 /* AppDelegate.h */, 68 | A6F541111FD7D93E002A3D24 /* AppDelegate.m */, 69 | A6F541131FD7D93E002A3D24 /* ViewController.h */, 70 | A6F541141FD7D93E002A3D24 /* ViewController.m */, 71 | A6F541161FD7D93E002A3D24 /* Main.storyboard */, 72 | A6F541191FD7D93E002A3D24 /* Assets.xcassets */, 73 | A6F5411B1FD7D93E002A3D24 /* LaunchScreen.storyboard */, 74 | A6F5411E1FD7D93F002A3D24 /* Info.plist */, 75 | A6F5411F1FD7D93F002A3D24 /* main.m */, 76 | ); 77 | path = UIDebuggingTool; 78 | sourceTree = ""; 79 | }; 80 | E273C8442305331B00A36CD8 /* UIDebuggingTool */ = { 81 | isa = PBXGroup; 82 | children = ( 83 | E273C8452305331B00A36CD8 /* UIDebuggingInformationOverlay+Enable.m */, 84 | E273C8462305331B00A36CD8 /* UIDebuggingTool.h */, 85 | E273C8472305331B00A36CD8 /* UIDebuggingTool.m */, 86 | ); 87 | path = UIDebuggingTool; 88 | sourceTree = ""; 89 | }; 90 | /* End PBXGroup section */ 91 | 92 | /* Begin PBXNativeTarget section */ 93 | A6F5410C1FD7D93E002A3D24 /* UIDebuggingTool */ = { 94 | isa = PBXNativeTarget; 95 | buildConfigurationList = A6F541231FD7D93F002A3D24 /* Build configuration list for PBXNativeTarget "UIDebuggingTool" */; 96 | buildPhases = ( 97 | A6F541091FD7D93E002A3D24 /* Sources */, 98 | A6F5410A1FD7D93E002A3D24 /* Frameworks */, 99 | A6F5410B1FD7D93E002A3D24 /* Resources */, 100 | ); 101 | buildRules = ( 102 | ); 103 | dependencies = ( 104 | ); 105 | name = UIDebuggingTool; 106 | productName = UIDebuggingTool; 107 | productReference = A6F5410D1FD7D93E002A3D24 /* UIDebuggingTool.app */; 108 | productType = "com.apple.product-type.application"; 109 | }; 110 | /* End PBXNativeTarget section */ 111 | 112 | /* Begin PBXProject section */ 113 | A6F541051FD7D93E002A3D24 /* Project object */ = { 114 | isa = PBXProject; 115 | attributes = { 116 | LastUpgradeCheck = 0910; 117 | ORGANIZATIONNAME = whf5566; 118 | TargetAttributes = { 119 | A6F5410C1FD7D93E002A3D24 = { 120 | CreatedOnToolsVersion = 9.1; 121 | ProvisioningStyle = Automatic; 122 | }; 123 | }; 124 | }; 125 | buildConfigurationList = A6F541081FD7D93E002A3D24 /* Build configuration list for PBXProject "UIDebuggingTool" */; 126 | compatibilityVersion = "Xcode 8.0"; 127 | developmentRegion = en; 128 | hasScannedForEncodings = 0; 129 | knownRegions = ( 130 | en, 131 | Base, 132 | ); 133 | mainGroup = A6F541041FD7D93E002A3D24; 134 | productRefGroup = A6F5410E1FD7D93E002A3D24 /* Products */; 135 | projectDirPath = ""; 136 | projectRoot = ""; 137 | targets = ( 138 | A6F5410C1FD7D93E002A3D24 /* UIDebuggingTool */, 139 | ); 140 | }; 141 | /* End PBXProject section */ 142 | 143 | /* Begin PBXResourcesBuildPhase section */ 144 | A6F5410B1FD7D93E002A3D24 /* Resources */ = { 145 | isa = PBXResourcesBuildPhase; 146 | buildActionMask = 2147483647; 147 | files = ( 148 | A6F5411D1FD7D93E002A3D24 /* LaunchScreen.storyboard in Resources */, 149 | A6F5411A1FD7D93E002A3D24 /* Assets.xcassets in Resources */, 150 | A6F541181FD7D93E002A3D24 /* Main.storyboard in Resources */, 151 | ); 152 | runOnlyForDeploymentPostprocessing = 0; 153 | }; 154 | /* End PBXResourcesBuildPhase section */ 155 | 156 | /* Begin PBXSourcesBuildPhase section */ 157 | A6F541091FD7D93E002A3D24 /* Sources */ = { 158 | isa = PBXSourcesBuildPhase; 159 | buildActionMask = 2147483647; 160 | files = ( 161 | A6F541151FD7D93E002A3D24 /* ViewController.m in Sources */, 162 | E273C8482305331B00A36CD8 /* UIDebuggingInformationOverlay+Enable.m in Sources */, 163 | A6F541201FD7D93F002A3D24 /* main.m in Sources */, 164 | E273C8492305331B00A36CD8 /* UIDebuggingTool.m in Sources */, 165 | A6F541121FD7D93E002A3D24 /* AppDelegate.m in Sources */, 166 | ); 167 | runOnlyForDeploymentPostprocessing = 0; 168 | }; 169 | /* End PBXSourcesBuildPhase section */ 170 | 171 | /* Begin PBXVariantGroup section */ 172 | A6F541161FD7D93E002A3D24 /* Main.storyboard */ = { 173 | isa = PBXVariantGroup; 174 | children = ( 175 | A6F541171FD7D93E002A3D24 /* Base */, 176 | ); 177 | name = Main.storyboard; 178 | sourceTree = ""; 179 | }; 180 | A6F5411B1FD7D93E002A3D24 /* LaunchScreen.storyboard */ = { 181 | isa = PBXVariantGroup; 182 | children = ( 183 | A6F5411C1FD7D93E002A3D24 /* Base */, 184 | ); 185 | name = LaunchScreen.storyboard; 186 | sourceTree = ""; 187 | }; 188 | /* End PBXVariantGroup section */ 189 | 190 | /* Begin XCBuildConfiguration section */ 191 | A6F541211FD7D93F002A3D24 /* Debug */ = { 192 | isa = XCBuildConfiguration; 193 | buildSettings = { 194 | ALWAYS_SEARCH_USER_PATHS = NO; 195 | CLANG_ANALYZER_NONNULL = YES; 196 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 197 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 198 | CLANG_CXX_LIBRARY = "libc++"; 199 | CLANG_ENABLE_MODULES = YES; 200 | CLANG_ENABLE_OBJC_ARC = YES; 201 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 202 | CLANG_WARN_BOOL_CONVERSION = YES; 203 | CLANG_WARN_COMMA = YES; 204 | CLANG_WARN_CONSTANT_CONVERSION = YES; 205 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 206 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 207 | CLANG_WARN_EMPTY_BODY = YES; 208 | CLANG_WARN_ENUM_CONVERSION = YES; 209 | CLANG_WARN_INFINITE_RECURSION = YES; 210 | CLANG_WARN_INT_CONVERSION = YES; 211 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 212 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 213 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 214 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 215 | CLANG_WARN_STRICT_PROTOTYPES = YES; 216 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 217 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 218 | CLANG_WARN_UNREACHABLE_CODE = YES; 219 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 220 | CODE_SIGN_IDENTITY = "iPhone Developer"; 221 | COPY_PHASE_STRIP = NO; 222 | DEBUG_INFORMATION_FORMAT = dwarf; 223 | ENABLE_STRICT_OBJC_MSGSEND = YES; 224 | ENABLE_TESTABILITY = YES; 225 | GCC_C_LANGUAGE_STANDARD = gnu11; 226 | GCC_DYNAMIC_NO_PIC = NO; 227 | GCC_NO_COMMON_BLOCKS = YES; 228 | GCC_OPTIMIZATION_LEVEL = 0; 229 | GCC_PREPROCESSOR_DEFINITIONS = ( 230 | "DEBUG=1", 231 | "$(inherited)", 232 | ); 233 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 234 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 235 | GCC_WARN_UNDECLARED_SELECTOR = YES; 236 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 237 | GCC_WARN_UNUSED_FUNCTION = YES; 238 | GCC_WARN_UNUSED_VARIABLE = YES; 239 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 240 | MTL_ENABLE_DEBUG_INFO = YES; 241 | ONLY_ACTIVE_ARCH = YES; 242 | SDKROOT = iphoneos; 243 | }; 244 | name = Debug; 245 | }; 246 | A6F541221FD7D93F002A3D24 /* Release */ = { 247 | isa = XCBuildConfiguration; 248 | buildSettings = { 249 | ALWAYS_SEARCH_USER_PATHS = NO; 250 | CLANG_ANALYZER_NONNULL = YES; 251 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 252 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 253 | CLANG_CXX_LIBRARY = "libc++"; 254 | CLANG_ENABLE_MODULES = YES; 255 | CLANG_ENABLE_OBJC_ARC = YES; 256 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 257 | CLANG_WARN_BOOL_CONVERSION = YES; 258 | CLANG_WARN_COMMA = YES; 259 | CLANG_WARN_CONSTANT_CONVERSION = YES; 260 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 261 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 262 | CLANG_WARN_EMPTY_BODY = YES; 263 | CLANG_WARN_ENUM_CONVERSION = YES; 264 | CLANG_WARN_INFINITE_RECURSION = YES; 265 | CLANG_WARN_INT_CONVERSION = YES; 266 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 267 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 268 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 269 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 270 | CLANG_WARN_STRICT_PROTOTYPES = YES; 271 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 272 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 273 | CLANG_WARN_UNREACHABLE_CODE = YES; 274 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 275 | CODE_SIGN_IDENTITY = "iPhone Developer"; 276 | COPY_PHASE_STRIP = NO; 277 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 278 | ENABLE_NS_ASSERTIONS = NO; 279 | ENABLE_STRICT_OBJC_MSGSEND = YES; 280 | GCC_C_LANGUAGE_STANDARD = gnu11; 281 | GCC_NO_COMMON_BLOCKS = YES; 282 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 283 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 284 | GCC_WARN_UNDECLARED_SELECTOR = YES; 285 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 286 | GCC_WARN_UNUSED_FUNCTION = YES; 287 | GCC_WARN_UNUSED_VARIABLE = YES; 288 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 289 | MTL_ENABLE_DEBUG_INFO = NO; 290 | SDKROOT = iphoneos; 291 | VALIDATE_PRODUCT = YES; 292 | }; 293 | name = Release; 294 | }; 295 | A6F541241FD7D93F002A3D24 /* Debug */ = { 296 | isa = XCBuildConfiguration; 297 | buildSettings = { 298 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 299 | CODE_SIGN_STYLE = Automatic; 300 | DEVELOPMENT_TEAM = NAY9JJLW74; 301 | INFOPLIST_FILE = UIDebuggingTool/Info.plist; 302 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 303 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 304 | PRODUCT_BUNDLE_IDENTIFIER = com.whf5566.UIDebuggingTool; 305 | PRODUCT_NAME = "$(TARGET_NAME)"; 306 | TARGETED_DEVICE_FAMILY = "1,2"; 307 | }; 308 | name = Debug; 309 | }; 310 | A6F541251FD7D93F002A3D24 /* Release */ = { 311 | isa = XCBuildConfiguration; 312 | buildSettings = { 313 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 314 | CODE_SIGN_STYLE = Automatic; 315 | DEVELOPMENT_TEAM = NAY9JJLW74; 316 | INFOPLIST_FILE = UIDebuggingTool/Info.plist; 317 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 318 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 319 | PRODUCT_BUNDLE_IDENTIFIER = com.whf5566.UIDebuggingTool; 320 | PRODUCT_NAME = "$(TARGET_NAME)"; 321 | TARGETED_DEVICE_FAMILY = "1,2"; 322 | }; 323 | name = Release; 324 | }; 325 | /* End XCBuildConfiguration section */ 326 | 327 | /* Begin XCConfigurationList section */ 328 | A6F541081FD7D93E002A3D24 /* Build configuration list for PBXProject "UIDebuggingTool" */ = { 329 | isa = XCConfigurationList; 330 | buildConfigurations = ( 331 | A6F541211FD7D93F002A3D24 /* Debug */, 332 | A6F541221FD7D93F002A3D24 /* Release */, 333 | ); 334 | defaultConfigurationIsVisible = 0; 335 | defaultConfigurationName = Release; 336 | }; 337 | A6F541231FD7D93F002A3D24 /* Build configuration list for PBXNativeTarget "UIDebuggingTool" */ = { 338 | isa = XCConfigurationList; 339 | buildConfigurations = ( 340 | A6F541241FD7D93F002A3D24 /* Debug */, 341 | A6F541251FD7D93F002A3D24 /* Release */, 342 | ); 343 | defaultConfigurationIsVisible = 0; 344 | defaultConfigurationName = Release; 345 | }; 346 | /* End XCConfigurationList section */ 347 | }; 348 | rootObject = A6F541051FD7D93E002A3D24 /* Project object */; 349 | } 350 | --------------------------------------------------------------------------------