Comparing two CGRects Comparing two CGRects ios ios

Comparing two CGRects


Use this:

if (CGRectEqualToRect(self.view.frame, rect)) {     // do some stuff}


See the documentation for CGRectEqualToRect().

bool CGRectEqualToRect ( CGRect rect1, CGRect rect2 );


In the Swift 3 it would be:

frame1.equalTo(frame2)