func +( left: Vector, right: Vector) -> Vector {
return left.vectorByAddingVector( right)
}
func *( left: Vector, right: Double) -> Vector {
return Vector( x: left.x * right , y: left.y * right)
}
Hillegass, Aaron; Preble, Adam; Chandler, Nate (2015-04-16). Cocoa Programming for OS X: The Big Nerd Ranch Guide (5th Edition) (Big Nerd Ranch Guides) (Kindle Locations 1736-1737). Pearson Education. Kindle Edition.
Should be (space between the operator and the open parens:
func + ( left: Vector, right: Vector) -> Vector {
return left.vectorByAddingVector( right)
}
func * ( left: Vector, right: Double) -> Vector {
return Vector( x: left.x * right , y: left.y * right)
}