How do I check if a CGPoint has been initialised?

后端 未结 6 1825
你的背包
你的背包 2021-02-07 02:59

I would like to initially set a CGPoint property to a particular point (middle of screen). Other methods may subsequently wish to change this property. My thoughts were to initi

6条回答
  •  长发绾君心
    2021-02-07 03:16

    An easier way would be to initialize _graphOrigin to CGRectZero and change your if statement for this:

    if (!CGPointEqualToPoint(_graphOrigin, CGPointZero)) {  
    
    }
    

提交回复
热议问题