@IBAction func OnRightSwipeGesture(sender: UIPanGestureRecognizer) {
let translated = sender.translationInView(self.view);
let diffTrans = (translated.y - previouslyTranslated.y) / 75;
sum += diffTrans;
print(sum);
colorWheel.transform = CGAffineTransformMakeRotation(sum);
previouslyTranslated = translated;
}In this code, I'm using a swipe gesture to turn a wheel. It takes the difference in movement between calls and adds them to sum, which then becomes the rotation of the wheel. The problems is, however, that once I have taken my finger off the screen sum gets reset to 0 on the next gesture call even though its a variable declared at the top of the class. I'm somewhat new to swift and in other languages that's called an instance variable. Do they not behave the same way in swift?