You can add the width and height of the rectangle to get the coordinates of the other three points.
CGRect rect = view.bounds; CGPoint topLeft = rect.origin; CGPoint topRight = CGPointMake(rect.origin.x + rect.size.width, rect.origin.y); CGPoint bottomLeft =CGPointMake(rect.origin.x, rect.origin.y + rect.size.height); CGPoint bottomRight = CGPointMake(rect.origin.x + rect.size.width, rect.origin.y + rect.size.height);
Then you can use CGPointApplyAffineTransform to get the transformed coordinates from them according to the specified transformation.
CGPoint center = view.center; CGAffineTransform transf = CGAffineTransformMakeTranslation(-rect.size.width/2, -rect.size.height/2); transf = CGAffineTransformConcat(transf, view.transform); transf = CGAffineTransformTranslate(transf, center.x, center.y); topLeft = CGPointApplyAffineTransform(topLeft, transf);
(note: not verified.)
source share