CGFloat

From Xojo Documentation

Data Type


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

Notes

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

See Also

Double, Single, Declare