Last active
December 15, 2015 05:19
-
-
Save johnomarkid/5207737 to your computer and use it in GitHub Desktop.
DRect is a module to ease the pain of logging CGRect
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
DRect | |
===== | |
For iOS/OSX development. | |
If you are sick of NSLogging your CGRects like this: | |
NSLog(@"x_origin: %f, y_origin: %f, width: %f, height: %f",view.frame.origin.y, view.frame.origin.x, view.frame.size.width, view.frame.size.height); | |
DRect that shit. | |
DRect(view.frame); | |
Put this macro in your .pch file or somewhere else and start logging CGRects like they should be logged. | |
#ifdef DEBUG | |
# define DRect( rect ) NSLog( @"CGRect ( %f, %f, %f, %f)", rect.origin.x, rect.origin.y, rect.size.width, rect.size.height); | |
#else | |
# define DRect(...) | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What about
NSStringFromCGRect(CGRect rect)
?