let dx = line.frame.midX - other.frame.midX
produces the following exception:
Ambiguous use of operator '-'
Here is the line & other class' object type declaration:
import Foundation
import SpriteKit
class Line: SKShapeNode {
var plane:Plane!
init(rect: CGRect, plane: Plane) {
super.init()
self.path = CGPathCreateWithRect(rect, nil)
self.plane = plane
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
I noticed that when I Jump to definition (⌘ + click) in Xcode the frame
object takes me to the frame
property in UIView
instead of SKNode
.
Am I not subclassing correctly? How do I get rid of the Ambiguous use of operator exception error?