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
-
first
starting position to check adjacent direction from
-
direction
direction of adjacency to check
-
second
ending position to check adjacent direction to
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:
- HSWidgetDirectionLeft
- HSWidgetDirectionUp
- HSWidgetDirectionRight
- HSWidgetDirectionDown
Related Links
Using Relative Directions
-
HSWidgetPositionInDirection
Returns a adjacent position in given direction.
-
HSWidgetReverseDirection
Returns a direction that is directly opposite of specified direction.