Created
March 22, 2012 19:53
-
-
Save matthewhudson/2162865 to your computer and use it in GitHub Desktop.
Cocoa NSLog() Frame & Bounds
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
// The bounds of an UIView is the rectangle, expressed as a location (x,y) and size (width,height) relative to its own coordinate system (0,0). | |
NSLog(@"bounds.origin.x: %f", thing.bounds.origin.x); | |
NSLog(@"bounds.origin.y: %f", thing.bounds.origin.y); | |
NSLog(@"bounds.size.width: %f", thing.bounds.size.width); | |
NSLog(@"bounds.size.height: %f", thing.bounds.size.height); | |
// The frame of an UIView is the rectangle, expressed as a location (x,y) and size (width,height) relative to the superview it is contained within. | |
NSLog(@"frame.origin.x: %f", thing.frame.origin.x); | |
NSLog(@"frame.origin.y: %f", thing.frame.origin.y); | |
NSLog(@"frame.size.width: %f", thing.frame.size.width); | |
NSLog(@"frame.size.height: %f", thing.frame.size.height); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment