Protocol
HSWidgetDelegate
Methods for managing widgets, performing accessory events and notify option changes.
Declaration
@protocol HSWidgetDelegate
Overview
HSWidgets has a widget manager that conforms to this protocol so these methods should never need to be implemented. However, advanced widgets can call these methods instead of using the convenience methods for more control.
Call the methods of this protocol for:
- Removing widget from page
- Displaying settings page
- Notifying widget manager of options changes so that it can save them
- Dragging management
- Checking and performing expand/shrink accessories
- Converting preferred position to a valid position on page
Topics
Perform Accessory Events
-
- closeTapped:
Tells the delegate to remove the specified widget.
-
- settingsTapped:
Tells the delegate to display the settings view controller.
Notify of Options Changes
-
- widgetOptionsChanged:
Notifies delegate of options changes so that delegate can save them.
Widget Dragging
-
- canDragWidget:
Return whether the widget can begin or continue dragging.
-
- setDraggingWidget:
Set the current widget being dragged.
-
- widgetDragged:toPoint:
Notify of dragging changes so delegate can animate it.
Widget Sizing
-
- canWidget:expandOrShrinkToGridPositions:
Return whether widget can expand or shrink to the specified widget positions.
-
- updatePageForExpandOrShrinkOfWidget:toGridPositions:
Expand or shrink widget to the specified widget positions.
Getting Valid Origin
-
- widgetOriginForWidgetSize:withPreferredOrigin:
Get a valid origin on page from a preferred origin.
Related Links
Widget
-
HSWidgetViewController
A view controller that specializes in managing a widget view.