Skip to content

Instantly share code, notes, and snippets.

@celian-m
Last active March 3, 2016 14:09
Show Gist options
  • Save celian-m/207674447dd482c4d54f to your computer and use it in GitHub Desktop.
Save celian-m/207674447dd482c4d54f to your computer and use it in GitHub Desktop.
iOS debugQuickLookObject

#Visual Debuging# If you are borred to use po myObject to check the content of your objects, you may use debugQuickLookObject, an XCode hidden gem.

Assuming your object is a subclass of NSObject

- (id)debugQuickLookObject {
    UIImage* img = [UIImage imageNamed:self.productThumbImage];
    UIImageView* view = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, img.size.width, img.size.height)];
    view.image = img;
    return view;
}

This code will let you use the quick look preview when XCode is stopped for debug : Quick Look Preview

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment