What is a CGFloat?

Posted huaan011

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了What is a CGFloat?相关的知识,希望对你有一定的参考价值。

原文:https://www.hackingwithswift.com/example-code/language/what-is-a-cgfloat

CGFloat is a specialized form of Float that holds either 32-bits of data or 64-bits of data depending on the platform. The CG tells you it‘s part of Core Graphics, and it‘s found throughout UIKit, Core Graphics, Sprite Kit and many other ios libraries.

CGFloat是一种特殊形式的Float,根据平台的不同,它可以保存32位数据或64位数据。CG告诉你它是核心图形的一部分,它可以在UIKit、核心图形、Sprite Kit和许多其他iOS库中找到。

If you have a Float or Double and need a CGFloat, you can convert it like this:

let myCGFloat = CGFloat(myDouble)

  

以上是关于What is a CGFloat?的主要内容,如果未能解决你的问题,请参考以下文章

What is a shell and what is Bash?

What is the reason that a likelihood function is not a pdf?

高中必修3Module 3 Period 1 Reading— What Is a Tornado?翻译!急!急!!急!!!

What is a Database Trigger?

what-is-a-closure

What is a Thread?