Oleg Savelyev
Oleg Savelyev

Reputation: 275

CGPoint compiler error

I've tried to write an expression:

 var  moveDifference: CGPoint = CGPoint(touchPoint.x - self.anchorPointInPoints().x, touchPoint.y - self.anchorPointInPoints().y)

But xcode swears:

Argument labels '(_:, _:)' do not match any available overloads

Please help to fix that problem.

Thanks in advance.

Upvotes: 0

Views: 43

Answers (1)

Paulo Mattos
Paulo Mattos

Reputation: 19349

You missed the argument labels on the CGPoint initializer:

CGPoint(x: ..., y: ...)

Also: thanks to type inference, you really don't need to redeclare your var type:

var moveDifference = CGPoint(...

Upvotes: 1

Related Questions