How to declare my very own CGRectZero like constant?

前端 未结 4 1627
失恋的感觉
失恋的感觉 2021-01-31 18:54

This is a newbie C/Objective-C question :-)

Let say I want a CGRectOne and a CGRectTwo constants.

How can I declare that?

Thanks, Jérémy

4条回答
  •  囚心锁ツ
    2021-01-31 19:31

    Something like this

    static CGRect CGRectOne = (CGRect){.origin.x = 1.0f, .origin.y = 1.0f, .size.width = 1.0f, .size.height = 1.0f};
    

提交回复
热议问题