Skip to content

Commit

Permalink
Add logging to debug app layout
Browse files Browse the repository at this point in the history
  • Loading branch information
rpetrich committed Jan 23, 2012
1 parent ec7d182 commit 47262fc
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Hooks/Belfry.plist
@@ -1 +1 @@
{ Filter = { Bundles = ( "com.apple.springboard" ); }; }
{ Filter = { Bundles = ( "com.apple.springboard", "com.apple.stocks", "com.apple.VoiceMemos", "com.apple.mobiletimer", "com.apple.weather" ); }; }
27 changes: 27 additions & 0 deletions Hooks/Hooks.x
@@ -1,4 +1,5 @@
#import <SpringBoard/SpringBoard.h>
#import <UIKit/UIKit2.h>

%config(generator=internal)

Expand All @@ -21,3 +22,29 @@
}

%end

%hook UIApplication

- (void)motionEnded:(UIEventSubtype)motion withEvent:(id)event
{
NSLog(@"Layout: %@", [[self keyWindow] recursiveDescription]);
%orig;
}

%end

%hook UIView

- (NSMutableString *)description
{
UIViewController *vc = [UIViewController viewControllerForView:self];
if (!vc)
return %orig;
NSMutableString *result = [[%orig mutableCopy] autorelease];
NSInteger position = [result length] - 1;
[result insertString:[vc description] atIndex:position];
[result insertString:@" viewController = " atIndex:position];
return result;
}

%end
1 change: 1 addition & 0 deletions Hooks/Makefile
Expand Up @@ -3,6 +3,7 @@ include theos/makefiles/common.mk

TWEAK_NAME = Belfry
Belfry_FILES = Hooks.x
Belfry_FRAMEWORKS = UIKit

include $(THEOS_MAKE_PATH)/tweak.mk

0 comments on commit 47262fc

Please sign in to comment.