Skip to content

Instantly share code, notes, and snippets.

@justin
Created April 30, 2014 05:29
Show Gist options
  • Save justin/37d63f3d28cb20774184 to your computer and use it in GitHub Desktop.
Save justin/37d63f3d28cb20774184 to your computer and use it in GitHub Desktop.
#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