标签: swift
我正在查看Objective-C常量long long int和float数字的Swift别名。
long long int
float
也就是说,如何将1000LL和.1f转换为Swift代码?
1000LL
.1f
此处未找到任何信息:
https://developer.apple.com/library/ios/documentation/Swift/Conceptual/BuildingCocoaApps/InteractingWithCAPIs.html
答案 0 :(得分:3)
当您需要在Swift中指定文字类型时,使用as - 转换。
as
1000LL - > 1000 as Int64
1000 as Int64
.1f - > 0.1 as Float
0.1 as Float