DJI Mobile SDK Documentation

      class DUXWidgetCollectionView

      @interface DUXWidgetCollectionView : UICollectionView <DUXWidgetCollectionViewProtocol>
      Header:DUXWidgetCollectionView.h
      Inherits From:UICollectionView
      Description:

      This subclass of UICollectionView is used as a base class for all predefined views under control by any of the predefined collection view controllers. This implements the DUXWidgetCollectionViewProtocol which enables the control over widgets.

      Class Members:
      property interactionExpectationLevel
      @property DUXWidgetInteractionExpectionLevel interactionExpectationLevel
      Header:DUXWidgetCollectionView.h
      Description:

      The interaction expectation level to be applied by default to all widgets inserted into this collection view.

      See Also:

      DUXWidgetInteractionExpectionLevel

      property
      property widgets
      @property (readonly, nonatomic, nonnull) NSArray <DUXWidgetItem *> *widgets
      Header:DUXWidgetCollectionView.h
      Description:

      The array of DUXWidgetItem widgets items.

      See Also:

      DUXWidgetItem

      protocol DUXWidgetCollectionViewProtocol
      @protocol DUXWidgetCollectionViewProtocol <NSObject>
      Header:DUXWidgetCollectionViewProtocol.h
      Inherits From:NSObject
      Description:

      This protocol defines the behavior expected for view to become widget collection views.

      Protocol Methods:
      property
      property widgets
      @property (readonly, nonatomic, nonnull) NSArray <DUXWidgetItem *> *widgets
      Header:DUXWidgetCollectionViewProtocol.h
      Description:

      The array of DUXWidgetItem widgets items.

      See Also:

      DUXWidgetItem

      method indexOfWidget
      @required
      - (NSInteger)indexOfWidget:(nonnull UIView <DUXWidgetProtocol> *)widget
      Header:DUXWidgetCollectionViewProtocol.h
      Description:

      The index in the widget item array of the passed widget.

      Input Parameters:
      nonnull UIView <DUXWidgetProtocol> * widgetThe widget whose index is desired.
      Return:
      NSIntegerAn index
      method
      method addWidget
      @required
      - (void)addWidget:(nonnull UIView<DUXWidgetProtocol> *)newWidget
      Header:DUXWidgetCollectionViewProtocol.h
      Description:

      Adds the passed widget to the collection. The collection layout system will then place it where it belongs visually.

      Input Parameters:
      nonnull UIView<DUXWidgetProtocol> * newWidgetThe widget being added.
      method addWidget:withEdgeInset
      @required
      - (void)addWidget:(nonnull UIView<DUXWidgetProtocol> *)newWidget withEdgeInset:(UIEdgeInsets)edgeInset
      Header:DUXWidgetCollectionViewProtocol.h
      Description:

      Adds the passed widgets and applies the given edge insets.

      Input Parameters:
      nonnull UIView<DUXWidgetProtocol> * newWidgetThe widget being added.
      UIEdgeInsets edgeInsetThe desired edge inset of the widget.
      method removeWidget
      @required
      - (void)removeWidget:(nonnull UIView<DUXWidgetProtocol> *)oldWidget
      Header:DUXWidgetCollectionViewProtocol.h
      Description:

      Removes the widget from the collection. Its widgetItem will be removed too.

      Input Parameters:
      nonnull UIView<DUXWidgetProtocol> * oldWidgetThe widget being removed.
      method insertWidget:atIndex
      @required
      - (void)insertWidget:(nonnull UIView<DUXWidgetProtocol> *)widget atIndex:(NSUInteger)index
      Header:DUXWidgetCollectionViewProtocol.h
      Description:

      Inserts the passed widget at the passed index.

      Input Parameters:
      nonnull UIView<DUXWidgetProtocol> * widgetThe widget being inserted.
      NSUInteger indexThe desired index of the widget.
      method insertWidget:withEdgeInset:atIndex
      @required
      - (void)insertWidget:(nonnull UIView<DUXWidgetProtocol> *)newWidget withEdgeInset:(UIEdgeInsets)edgeInset atIndex:(NSUInteger)index
      Header:DUXWidgetCollectionViewProtocol.h
      Description:

      Inserts the passed widget at the passed index and then applies the given edge insets.

      Input Parameters:
      nonnull UIView<DUXWidgetProtocol> * newWidgetThe widget being inserted.
      UIEdgeInsets edgeInsetThe desired edge inset of the widget.
      NSUInteger indexThe desired index of the widget.
      method widgetsInWidgetItems
      @required
      - (nullable NSArray <DUXWidget *> *)widgetsInWidgetItems:(nonnull NSArray <DUXWidgetItem *> *)widgetItems
      Header:DUXWidgetCollectionViewProtocol.h
      Description:

      Extracts the widgets from the widgetItems array passed and returns them into a new array.

      Input Parameters:
      nonnull NSArray <DUXWidgetItem *> * widgetItemsThe widgets extracted from the widgetItems array.
      Return:
      nullable NSArray <DUXWidget *> *a UIView <DUXWidgetProtocol> * object