I tried to answer to this question that is about difference between view.frame and view.bounds :
I've written this:
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
[self showPropertiesOfLabel];
self.label.transform = CGAffineTransformMakeRotation(M_PI * 0.25);
[self showPropertiesOfLabel];
}
- (void) showPropertiesOfLabel {
NSLog(@"bounds.origin.x: %f", self.label.bounds.origin.x);
NSLog(@"bounds.origin.y: %f", self.label.bounds.origin.x);
NSLog(@"bounds.size.width : %f", self.label.bounds.size.width);
NSLog(@"bounds.size.height: %f", self.label.bounds.size.height);
NSLog(@"frame.origin.x : %f", self.label.frame.origin.x);
NSLog(@"frame.origin.y : %f", self.label.frame.origin.y);
NSLog(@"frame.size.width : %f", self.label.frame.size.width);
NSLog(@"frame.size.width : %f", self.label.frame.size.height);
}
But what's stroked me was the fact that my view that I called "label" after
self.label.transform = CGAffineTransformMakeRotation(M_PI * 0.25);
dissapeared! But still reporting it's frame and bounds values (rather appropriately).
The most interesting part is that if I changed angle of rotation :
self.label.transform = CGAffineTransformMakeRotation(M_PI * 0.26);
It works as it should. The view don't disappear anymore!
I've test it both on the device as in the simulator:
Here is the video of it, testing in simulator:
PS:
It looks for me like a bug.
EDIT:
It looks like this behavior (bug?) is caused by Autolayout mechanisms.
You can turn it OFF by clicking at your storyboard file and at the right of Xcode there should be tab "Show the file inspector" and uncheck this box:
Here is video proving that this is in fact problem with Autolayout:
But this still don't answer the question.