What's the difference between using CGFloat and float?

前端 未结 5 597
忘了有多久
忘了有多久 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 18:40

    just mention that - Jan, 2020 Xcode 11.3/iOS13

    Swift 5

    From the CoreGraphics source code

    public struct CGFloat {
        /// The native type used to store the CGFloat, which is Float on
        /// 32-bit architectures and Double on 64-bit architectures.
        public typealias NativeType = Double
    

提交回复
热议问题