Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to compare two CGSize variables?

I want to make sure a CGSize is smaller or equal to another CGSize. like:

CGSize firstSize = CGSizeMake(1.0,1.0); CGSize secondSize = CGSizeMake(5.0,3.0); if(firstSize <= secondSize){     Do Stuff . . . } 

How would I compare this?

like image 544
Dvir Levy Avatar asked Jun 19 '12 19:06

Dvir Levy


1 Answers

To check for equality you can use, CGSizeEqualToSize function by Apple.

CGSize firstSize = CGSizeMake(1.0,1.0); CGSize secondSize = CGSizeMake(5.0,3.0);  if(CGSizeEqualToSize(firstSize, secondSize)) {     //they are equal }else{     //they aren't equal } 
like image 102
iOS-programmer Avatar answered Oct 12 '22 09:10

iOS-programmer