Hi
In this code
func swipeGesture(sender: UISwipeGestureRecognizer)
{
let _: UISwipeGestureRecognizerDirection = .up
let text: String
switch sender.direction {
case UISwipeGestureRecognizerDirection.right: text = "Right"
case UISwipeGestureRecognizerDirection.left: text = "Left"
case UISwipeGestureRecognizerDirection.up: text = "Up"
case UISwipeGestureRecognizerDirection.down: text = "Down"
default: text = "Unknown"
}
label.text = text
the compiler is happy to have the .up. but in the swtich it needs the whole huge name, thus defeating the aim of keeping swift code short. The compiler message if I take out UISwipeGestureRecognizerDirection and just leave .right is:
"Enum case 'right' not found in type 'UISwipeGestureRecognizerDirection'
Is this a bug in the compiler, or is there some reason for this that I am missing?