From Xojo Documentation

Revision as of 18:45, 8 June 2018 by PLefebvre (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!

Data Type

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

See Also

Double, Single, Declare