Created
April 30, 2014 05:29
-
-
Save justin/37d63f3d28cb20774184 to your computer and use it in GitHub Desktop.
This file contains 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
#import <objc/objc-runtime.h> | |
#import "UIView+SGAutoLayoutExtensions.h" | |
@implementation UIView (SGAutoLayoutExtensions) | |
#ifdef DEBUG | |
- (NSString *)nsli_description | |
{ | |
return [self restorationIdentifier] ?: [NSString stringWithFormat:@"%@:%p", [self class], self]; | |
} | |
- (BOOL)nsli_descriptionIncludesPointer | |
{ | |
return [self restorationIdentifier] == nil; | |
} | |
- (NSString *)sg_description | |
{ | |
// Evil! | |
NSString *string = [self performSelector:@selector(nsli_description)]; | |
if (self.restorationIdentifier != nil) | |
{ | |
return [string stringByAppendingFormat:@" (%@)", self.restorationIdentifier]; | |
} | |
return string; | |
} | |
#endif | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment