Class
HSWidgetGridPositionConverterCache
An object that coverts between various widget structures and grid positions.
Declaration
@interface HSWidgetGridPositionConverterCache : NSObject
Overview
HSWidgetGridPositionConverterCache provides a set of convenient methods to convert between various widget structures and grid structures. When convertions are performed, the results are stored in a cache to improve performance. However, this cache is very small in order to not take a big chunk of memory while also providing some speed benefits for subsequent calls.
Even though the name suggests its a converter cache, it provides a lot more convenience methods than that. For instance, originForWidgetOfSize:inGridPositions: can be used to find the origin position where the given size could be added. And one of the canFitWidgetofSize:inGridPositions: or canFitWidget:inGridPositions: can be used for checking placement within grid positions.
Topics
Getting Grid Positions
-
+ gridPositionsForWidgetFrame:
Get the grid positions that specified widget frame would occupy.
Getting Origin
-
+ originForWidgetOfSize:inGridPositions:
Get the origin position where the given size could be added within the specified grid positions.
Checking Placement
-
+ canFitWidgetOfSize:inGridPositions:
Return whether the given size can fit inside the specified grid positions.
-
+ canFitWidget:inGridPositions:
Return whether the given widget positions can fit inside the specified grid positions.
Related Links
Positions
-
HSWidgetPositionObject
An object wrapper for widget position structure.
Structures
-
HSWidgetFrame
A structure that contains location and dimensions of widget in grid positions.
-
HSWidgetSize
A structure that contains dimensions in grid positions.