-5

I have some code that is supposed to swipe a sprite in any direction taking in an initial value of a CGPoint.

I tried setting up a variable for this as

    var initialLocation:CGPoint = 0

I know this is not how you're supposed to do it but I forgot how it goes.

1 Answers1

2

It's a point, so it has to have two coordinates (x, y):

var initialLocation: CGPoint = .zero

or

var initialLocation: CGPoint = CGPoint(x: 0, y: 0)
rs7
  • 1,618
  • 1
  • 8
  • 16