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?
You can compare it to CGSizeZero or an arbitrary size that you consider invalid.
if (!CGSizeEqualToSize(CGSizeZero, mySize)) {
// do something
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With