I always had the impression the origin of a View defines its position inside a parent view. But in my application the Origin is 0,0 no matter where I move my view on the Interface.
This is the code I use:
- (void)drawRect:(CGRect)rect
{
float orginX = rect.origin.x;
float orginY = rect.origin.y;
NSLog(@"X-Origin %f.", orginX);
NSLog(@"Y-Origin %f.", orginY);
Where is my mistake?
The rect passed in to drawRect: is the view’s bounds, not it’s frame, so its origin will be 0,0.