I can’t seem to find an answer to this. Here nor documentation. Maybe I’m not sure what I should be looking for?
unsigned int unitFlags = NSHourCalendarUnit | NSMinuteCalendarUnit | NSDayCalendarUnit | NSMonthCalendarUnit;
From my understanding those should be logical bitwise operators for “OR”
How do they work in this situation?
bitwise operators used like this is a way of setting multiple boolean flags in one variable, called a bitmask
so if
and i set
it is the or of
So in your example you are setting the unit flags to be Hour, Minute, Day and Month