DJI Mobile SDK Documentation

      class DUXWidget

      @interface DUXWidget : UIView <DUXWidgetProtocol, NSCopying>
      Header:DUXWidget.h
      Inherits From:UIView
      Description:

      DUXWidget is the base class of all widgets in the UXSDK. It is the default implementation of a UIView that implements the DUXWidgetProtocol.

      Class Members:
      property
      property aspectRatio
      @property CGFloat aspectRatio
      Header:DUXWidget.h
      Description:

      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
      property action
      @property (strong, nonatomic, nullable) DUXWidgetActionBlock action
      Header:DUXWidget.h
      Description:

      An action block that defines whether or not a widget will trigger an action and what action it will trigger on TouchUp Inside.

      See Also:

      DUXWidgetActionBlock

      typedef block DUXWidgetActionBlock
      typedef void (^DUXWidgetActionBlock)()
      Header:DUXWidgetProtocol.h
      Description:

      Action block for Widget.

      method prepareWidget
      - (void)prepareWidget
      Header:DUXWidget.h
      Description:

      prepareWidget is called after init to allow you to customize basic information about the widget such as aspectRatio and interactionExpectationLevel.

      property interactionExpectationLevel
      @property DUXWidgetInteractionExpectionLevel interactionExpectationLevel
      Header:DUXWidget.h
      Description:

      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.

      See Also:

      DUXWidgetInteractionExpectionLevel

      property collectionView
      @property (nullable, nonatomic, weak) DUXWidgetCollectionView *collectionView
      Header:DUXWidget.h
      Description:

      If this widget is in a collection view, this will be set to that view when adding the widget to the collection.

      See Also:

      DUXWidgetCollectionView

      protocol DUXWidgetProtocol
      @protocol DUXWidgetProtocol <NSObject, DUXObjectProtocol>
      Header:DUXWidgetProtocol.h
      Inherits From:NSObject, DUXObjectProtocol
      Description:

      This protocol defines the behavior of a widget. This is usually to be implemented by a subclass of UIView

      Protocol Methods:
      property
      property aspectRatio
      @property CGFloat aspectRatio
      Header:DUXWidgetProtocol.h
      Description:

      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
      property action
      @property (strong, nonatomic, nullable) DUXWidgetActionBlock action
      Header:DUXWidgetProtocol.h
      Description:

      An action block that defines whether or not a widget will trigger an action and what action it will trigger on TouchUp Inside.

      See Also:

      DUXWidgetActionBlock

      property interactionExpectationLevel
      @property DUXWidgetInteractionExpectionLevel interactionExpectationLevel
      Header:DUXWidgetProtocol.h
      Description:

      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.

      See Also:

      DUXWidgetInteractionExpectionLevel

      property collectionView
      @property (nullable, nonatomic, weak) DUXWidgetCollectionView *collectionView
      Header:DUXWidgetProtocol.h
      Description:

      The optional widget collection view that contains the widget. This allows some widgets to let the collection know that they have resizing need.

      See Also:

      DUXWidgetCollectionView

      property
      property minimumSize
      @property CGSize minimumSize
      Header:DUXWidgetProtocol.h
      Description:

      The minimum height and width of the widget.

      enum DUXWidgetInteractionExpectionLevel
      typedef NS_ENUM(NSUInteger, DUXWidgetInteractionExpectionLevel)
      Header:DUXWidgetProtocol.h
      Description:

      Interaction level expected by a widget. May be used to have different behavior implementation in a single widget depending on this value.

      Enum Members:
      DUXWidgetInteractionExpectionLevelNoneNo interaction expected.
      DUXWidgetInteractionExpectionLevelFullFull interaction expected.