Reputation: 21892
I'm trying to detect when a pan gesture ends. Under Objective-C, I would do something like the following:
- (void)panGesture:(UIPanGestureRecognizer *)gesture {
if (gesture.state == UIGestureRecognizerStateEnded) {
...
}
}
In my Swift project, it doesn't recognize UIGestureRecognizerStateEnded
... Maybe I just need to import something different(?)
Upvotes: 1
Views: 1769
Reputation: 14063
The equivalent is just
gesture.state == .Ended
or if you like
gesture.state == UIGestureRecognizerState.Ended
Upvotes: 8