What's the difference between using CGFloat and float?

前端 未结 5 605
忘了有多久
忘了有多久 2020-11-30 18:02

I tend to use CGFloat all over the place, but I wonder if I get a senseless \"performance hit\" with this. CGFloat seems to be something \"heavier\" than float, right? At wh

5条回答
  •  不知归路
    2020-11-30 19:01

    CGFloat is a regular float on 32-bit systems and a double on 64-bit systems

    typedef float CGFloat;// 32-bit
    typedef double CGFloat;// 64-bit
    

    So you won't get any performance penalty.

提交回复
热议问题