Enumeration
HSWidgetDirection
These constants are mask bits for specifying a direction from a widget position.
Declaration
typedef enum HSWidgetDirection : NSUInteger {
...
} HSWidgetDirection;
Overview
Directions follow natural coordinate space while positions continue to use iOS coordinate space where the origin is upper-left corner and positive extends towards the lower-right corner.
These constants are masks so bitwise operations can be performed to select multiple directions. However, selecting opposite directions such as HSWidgetDirectionUp and HSWidgetDirectionDown will cancel each other out when used in certain functions.
Topics
Directions
-
HSWidgetDirectionNone
The direction from the position is none/unknown.
-
HSWidgetDirectionLeft
The left direction from a position.
-
HSWidgetDirectionUp
The up direction from a position.
-
HSWidgetDirectionRight
The right direction from a position.
-
HSWidgetDirectionDown
The down direction from a position.
Using Relative Directions
-
HSWidgetPositionIsAdjacent
Returns whether position is directly adjacent in given direction from first specified position.
-
HSWidgetPositionInDirection
Returns a adjacent position in given direction.
-
HSWidgetReverseDirection
Returns a direction that is directly opposite of specified direction.