Inline Function

HSWidgetPositionIsAdjacent

Returns whether position is directly adjacent in given direction from first specified position.


Declaration


static inline BOOL HSWidgetPositionIsAdjacent(HSWidgetPosition first, HSWidgetDirection direction, HSWidgetPosition second);

Parameters

Return Value

YES if second position is directly adjacent in specified direction from first position; otherwise, NO. This function does not check diagonally, meaning passing in multiple directions will lead to precendence of one direction over others. The following precendence order will be used:

  1. HSWidgetDirectionLeft
  2. HSWidgetDirectionUp
  3. HSWidgetDirectionRight
  4. HSWidgetDirectionDown

Related Links


Using Relative Directions