CGFloat
CGFloat is a floating-point scalar type used in Apple graphics and UI frameworks to represent coordinates, sizes, and other geometric values. It underpins common geometric types such as CGPoint, CGSize, CGRect, and transforms like CGAffineTransform, providing a single numeric type for drawing and layout operations across the APIs.
The exact underlying type of CGFloat depends on the platform’s word size: on 32-bit environments it is
Because frameworks expect and return CGFloat values, code usually avoids mixing other floating-point types unnecessarily to
API and constants: Core Graphics provides platform-appropriate constants such as CGFLOAT_MIN and CGFLOAT_MAX, which reflect the
Summary: CGFloat offers a portable, architecture-aware floating type for core graphics and UI coordinates, enabling consistent