Provides an easy way to access the CGFloat type used with Mac and iOS API calls.


When used in a 32-bit app this is an alias to Single; in a 64-bit app it is an alias to Double.

CGFloat serves as a transitionary type until only 64-bit iOS and Mac builds are supported. At that point, CGFloat will be deprecated and Double should be used in its place.

Sample code

A Declare that uses CGFloat so that it works on both 32-bit and 64-bit builds automatically:

Declare Function initWithComponents Lib "UIKit" Selector "initWithRed:green:blue:alpha:" _
    (obj_id As Ptr, red As CGFloat, green As CGFloat, blue As CGFloat, alpha As CGFloat) As Ptr


All project types on all supported operating systems.

See also

Double, Single, Declare