Dvir Levy Dvir Levy - 1 year ago 179
Objective-C Question

How to compare two CGSize variables?

I want to make sure a

is smaller or equal to another
. 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?

Answer Source

Determine whether firstSize fits into secondSize without rotating:

if(firstSize.width <= secondSize.width && firstSize.height <= secondSize.height)
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download