I was looking into how one uses the UISwipeGestureRecognizer class in Objective-C and happened to run across an enum named UISwipeGestureRecognizerDirection.
Apple defines this as:
typedef enum {
UISwipeGestureRecognizerDirectionRight = 1 << 0,
UISwipeGestureRecognizerDirectionLeft = 1 << 1,
UISwipeGestureRecognizerDirectionUp = 1 << 2,
UISwipeGestureRecognizerDirectionDown = 1 << 3
}
I wasn't sure how the compiler interpreted the above, specifically the << operator. From looking it up, it appears to be the bitwise shift left - But I am afraid I dont understand how the operator works above.
Any direction is greatly appreciated. Thanks in advance!