@interface DUXWidget : UIView <DUXWidgetProtocol, NSCopying> |
Header: | DUXWidget.h |
Inherits From: | UIView |
DUXWidget is the base class of all widgets in the UXSDK. It is the default implementation of a UIView that implements the DUXWidgetProtocol
.
@property CGFloat aspectRatio |
Header: | DUXWidget.h |
The aspect ratio of the widget in width/height. This value may change. A widget with a variable aspectRatio inside a widget collection will request the collection to invalidate its layout. Default is 1.0.
@property (strong, nonatomic, nullable) DUXWidgetActionBlock action |
Header: | DUXWidget.h |
An action block that defines whether or not a widget will trigger an action and what action it will trigger on TouchUp Inside.
typedef void (^DUXWidgetActionBlock)() |
Header: | DUXWidgetProtocol.h |
Action block for Widget.
- (void)prepareWidget |
Header: | DUXWidget.h |
prepareWidget is called after init to allow you to customize basic information about the widget such as aspectRatio and interactionExpectationLevel.
@property DUXWidgetInteractionExpectionLevel interactionExpectationLevel |
Header: | DUXWidget.h |
The level of interaction that is expected by the widget. Some widget collections will carry a specific expectation for interaction. This information may be used by the widget in order to adjust its behavior slightly based on where it sits in the UI.
@property (nullable, nonatomic, weak) DUXWidgetCollectionView *collectionView |
Header: | DUXWidget.h |
If this widget is in a collection view, this will be set to that view when adding the widget to the collection.
@protocol DUXWidgetProtocol <NSObject, DUXObjectProtocol> |
Header: | DUXWidgetProtocol.h |
Inherits From: | NSObject, DUXObjectProtocol |
This protocol defines the behavior of a widget. This is usually to be implemented by a subclass of UIView
@property CGFloat aspectRatio |
Header: | DUXWidgetProtocol.h |
The aspect ratio of the widget design. Used by the widgetCollection to provide a resolution independant size that will fit the needs of the widget.
@property (strong, nonatomic, nullable) DUXWidgetActionBlock action |
Header: | DUXWidgetProtocol.h |
An action block that defines whether or not a widget will trigger an action and what action it will trigger on TouchUp Inside.
@property DUXWidgetInteractionExpectionLevel interactionExpectationLevel |
Header: | DUXWidgetProtocol.h |
Defines the level of interaction that is expected from the Widget. For instance, a widget with a None level is not expected to provide any touch handling. On the other hand, a widget with a Full level is expected to provide touch handling and events.
@property (nullable, nonatomic, weak) DUXWidgetCollectionView *collectionView |
Header: | DUXWidgetProtocol.h |
The optional widget collection view that contains the widget. This allows some widgets to let the collection know that they have resizing need.
@property CGSize minimumSize |
Header: | DUXWidgetProtocol.h |
The minimum height and width of the widget.
typedef NS_ENUM(NSUInteger, DUXWidgetInteractionExpectionLevel) |
Header: | DUXWidgetProtocol.h |
Interaction level expected by a widget. May be used to have different behavior implementation in a single widget depending on this value.
DUXWidgetInteractionExpectionLevelNone | No interaction expected. |
DUXWidgetInteractionExpectionLevelFull | Full interaction expected. |