-
-
Save fannheyward/6d3da74ba176e8390357 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Include https://github.com/steipete/Aspects in your project | |
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { | |
[UIButton aspect_hookSelector:@selector(touchesEnded:withEvent:) withOptions:AspectPositionAfter usingBlock:^(id<AspectInfo> info) { | |
UIButton *button = [info instance]; | |
UIView *topMostView = button.window.subviews.firstObject; | |
[self logSubviews:topMostView]; | |
} error:nil]; | |
return YES; | |
} | |
- (void)logSubviews:(UIView *)view { | |
for (UIView *subview in view.subviews) { | |
if ([subview isKindOfClass:[UITextField class]]) { | |
NSLog(@"Text: %@", ((UITextField *)subview).text); | |
} else { | |
[self logSubviews:subview]; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment