Skip to content

Commit ae34b2b

Browse files
creancrean
authored andcommitted
修复摇一摇导出当前UI结构问题
1 parent 8a00c87 commit ae34b2b

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
THEOS_DEVICE_IP = 192.168.2.6
22
ARCHS = armv7 armv7s arm64 arm64e
33
TARGET = iphone:latest:8.0
4+
ADDITIONAL_OBJCFLAGS = -fobjc-arc
45
include $(THEOS)/makefiles/common.mk
56

67
TWEAK_NAME = LookinLoader

Tweak.xm

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
#include <dlfcn.h>
33

44
%group UIDebug
5+
56
%hook UIResponder
67

78
- (void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event {
89
if (motion == UIEventSubtypeMotionShake) {
9-
// [[NSNotificationCenter defaultCenter] postNotificationName:@"Lookin_3D" object:nil];
10-
UIAlertView *alertView = [[UIAlertView alloc] init];
10+
UIAlertView *alertView = [[UIAlertView alloc] init];
1111
alertView.delegate = self;
1212
alertView.tag = 0;
1313
alertView.title = @"Lookin UIDebug菜单";
@@ -28,7 +28,12 @@
2828
} else if (buttonIndex == 1) {//3D视图
2929
[[NSNotificationCenter defaultCenter] postNotificationName:@"Lookin_3D" object:nil];
3030
}else if (buttonIndex == 2) {//导出当前UI结构
31-
[[NSNotificationCenter defaultCenter] postNotificationName:@"Lookin_Export" object:nil];
31+
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
32+
/*
33+
修复弹出UIDebug菜单导致无法正确弹出UIDocumentInteractionController问题,延后1秒等UIDebug菜单消失
34+
*/
35+
[[NSNotificationCenter defaultCenter] postNotificationName:@"Lookin_Export" object:nil];
36+
});
3237
}
3338
}
3439
}

0 commit comments

Comments
 (0)