Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check if a CGSize is initialized (or if its value is different from "nil") [duplicate]

I have a CGSize property in a class and I need to check if it has been initialized. I know that a CGSize isn't a object, but generally speaking, is the same idea of checking if an object is different from nil. How to do that?

like image 480
reinaldoluckman Avatar asked Feb 20 '14 19:02

reinaldoluckman


1 Answers

You can compare it to CGSizeZero or an arbitrary size that you consider invalid.

if (!CGSizeEqualToSize(CGSizeZero, mySize)) {
   // do something
}
like image 60
jervine10 Avatar answered Oct 21 '22 13:10

jervine10