I am currently using a cocoapod which was written in objective c. In the example they show something like that:
options.allowedSwipeDirections = MDCSwipeDirectionLeft | MDCSwipeDirectionRight;
I don't even know what these sort of variables are called but I already tried the following in Swift:
options.allowedSwipeDirections = MDCSwipeDirection.Left | MDCSwipeDirection.Right
But the compiler says No '|' candidates produce the expected contextual result type 'MDCSwipeDirection'
How would I do this in Swift?
Edit:
It looks like this is not an OptionSet
as stated in some answers, her is the declaration:
/*!
* Contains the directions on which the swipe will be recognized
* Must be set using a OR operator (like MDCSwipeDirectionUp | MDCSwipeDirectionDown)
*/
@property (nonatomic, assign) MDCSwipeDirection allowedSwipeDirections;
and it is used like that:
_allowedSwipeDirections = MDCSwipeDirectionLeft | MDCSwipeDirectionRight;