1
아래의 내 복식을 위해 내가하는 것처럼 객관적인 목표를 달성하는 것이 정말로 필요한가? 놀이터에서이 단계없이 작동하지만 보통의 신속한 파일에서는 컴파일되지 않습니다.float를 신속하게 ObjectiveC에 연결해야합니까?
더 깨끗한 방법이 있습니까?
var prevX = 0.0
var prevY = 0.0
var count = 0
for item : AnyObject in myGraph.vertices {
count++
if let v = item as? Vertex {
x = Double(x)
y = Double(y)
x = x - width/2.0
y = y - width/2.0
//var fwidth = Float(width)
var rect = CGRect()
rect.origin.x = x.bridgeToObjectiveC().floatValue
rect.origin.y = y.bridgeToObjectiveC().floatValue
rect.size.width = width.bridgeToObjectiveC().floatValue
rect.size.height = rect.size.width
https://developer.apple.com/library/prerelease/ios/documentation/swift/conceptual/swift_programming_language/TheBasics.html#//apple_ref/doc/uid/TP40014097-CH5-XID_416 –
는 관련이있는 것으로 나타남 대상이 64 비트인지 32 비트인지 여부 –
두 배는 64 비트 숫자이며, 항상 발생했습니다. 플로트는 32 비트 숫자이며, 항상 사용되었습니다. http://en.wikipedia.org/wiki/Double-precision_floating-point_format 및 http://en.wikipedia.org/wiki/Single-precision_floating-point_format –