简体   繁体   English

Double 或 CGFloat 或 String 的角度 - SwiftUI

[英]Angle to Double or CGFloat or String - SwiftUI

In swift Angle(degrees: 20.0), So now I want to convert or store that 20.0 in a Double or String or CGFloat.在 swift Angle(degrees: 20.0) 中,所以现在我想将 20.0 转换或存储在 Double 或 String 或 CGFloat 中。

What is the process?流程是什么?

Instances of type Angle have degrees property of type Double . Angle类型的实例具有Double类型的degrees属性。 See the documentation .请参阅文档

let angle = Angle(degrees: 20)
let degrees = angle.degrees // 20 of type Double

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 CGFloat 比 Double 更准确吗? - Is CGFloat more accurate than Double? SwiftUI 误导性错误:“Int”不可转换为“CGFloat” - SwiftUI misleading error: 'Int' is not convertible to 'CGFloat' 不兼容的块指针类型使用类型为'double(^)(CGFloat)'的表达式初始化'CGFloat(^ __ strong)(CGFloat)' - Incompatible block pointer types initializing 'CGFloat (^__strong)(CGFloat)' with an expression of type 'double (^)(CGFloat)' Swift编译错误:'Double'不能转换为CGFloat - Swift Compiler error: 'Double' is not convertible to CGFloat Swift(iOS)中的“'CGFloat'无法转换为'Double'”错误 - “'CGFloat' is not convertible to 'Double'” error in Swift (iOS) ObjectiveC测试int是否为long / CGFloat是float还是double - ObjectiveC test if int is long or not / CGFloat is float or double CGFloat或CGFloat *? - CGFloat or CGFloat *? SwiftUI:将 UserDefault Slider 值(双)转换为字符串中的 Int? - SwiftUI: Converting UserDefault Slider Value (Double) to an Int within a String? 如何基于字符串长度获取CGFloat / CGSize? - How to get CGFloat/CGSize based on String length? 对二进制表达式无效的操作数(“ CGFloat”(又名“ double”)和“ UIView * _Nullable”) - Invalid operands to binary expression ('CGFloat' (aka 'double') and 'UIView * _Nullable')
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM