Ahmad
Ahmad

Reputation: 97

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

Getting error:

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

in:

snap = UISnapBehavior(
    item: self, 
    snapToPoint: CGPoint(CGRectGetMidX(movement), CGRectGetMidY(movement))
)

How do I solve this error in Swift?

Upvotes: 1

Views: 1723

Answers (1)

lifewithelliott
lifewithelliott

Reputation: 1432

Because CGPoint requires the argument labels to be present ensure that you have them along with your initializer.

let midX = CGRectGetMidX(movement)
let midY = CGRectGetMidy(movement)

let point = CGPoint(x: midX , y: midY) // x & y Argument Labels Required With CGPoint Initializer

Upvotes: 1

Related Questions