You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To make it easier to read debug logs, add this category and make it so that when you tap on a view, it displays the tag name along with the class name. Also, the debug output should display these tags.
e.g.
[myview setNametag:@"My main view"]
when you tap on it, DCIntrospect should display "UIView - My main view {{0,0},{320,568}}" on the top status bar. Without this, you would only see "UIView" which is not helpful when you have many views and subviews!
To make it easier to read debug logs, add this category and make it so that when you tap on a view, it displays the tag name along with the class name. Also, the debug output should display these tags.
e.g.
[myview setNametag:@"My main view"]
when you tap on it, DCIntrospect should display "UIView - My main view {{0,0},{320,568}}" on the top status bar. Without this, you would only see "UIView" which is not helpful when you have many views and subviews!
Category code:
@interface UIView (NameTags)
@EnD
@implementation UIView (NameTags)
return (NSString *)objc_getAssociatedObject(self, @selector(nametag));
}
// Nametag setter
objc_setAssociatedObject(self, @selector(nametag), theNametag, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}
// Return 'Class description : hex memory address'
return [NSString stringWithFormat:@"%@:0x%0x", self.class.description, (int) self];
}
@EnD
The text was updated successfully, but these errors were encountered: