Skip to content

Instantly share code, notes, and snippets.

@jontelang
Created December 18, 2012 14:33
Show Gist options
  • Save jontelang/4328476 to your computer and use it in GitHub Desktop.
Save jontelang/4328476 to your computer and use it in GitHub Desktop.
Center badges 2
/*%hook SBIconImageContainerView
@interface SBIconImageContainerView : UIView
@end
-(void)addSubview:(UIView *)view{
//Class _icon = objc_getClass("SBIconBadgeImage");
Class _icon = objc_getClass("UIImageView");
if( [view isKindOfClass:_icon] )
{
[view setCenter:CGPointMake(self.bounds.size.width/2,view.bounds.origin.y)];
}
%orig;
}
%end*/
%hook SBIconView
@interface SBIconView : UIView
-(UIImageView*)_badgeView;
//-(void)_updateBadgePosition;
@end
-(void)updateBadge{
%orig;
NSLog(@"__________________________");
NSLog(@"__________________________");
NSLog(@"__________________________");
NSLog(@"__________________________");
NSLog(@"__________________________");
NSLog(@"__________________________");
NSLog(@"__________________________");
NSLog(@"__________________________");
NSLog(@"__________________________");
NSLog(@"__________________________");
NSLog(@"__________________________");
NSLog(@"__________________________");
NSLog(@"__________________________");
NSLog(@"%@", [self _badgeView]);
[[self _badgeView] setCenter:CGPointMake(self.bounds.size.width/2,self.bounds.origin.y)];
//[self _updateBadgePosition];
}
%end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment