DJI Mobile SDK Documentation

      class DUXWidgetCollectionViewController

      @interface DUXWidgetCollectionViewController : UIViewController <DUXWidgetCollectionViewControllerProtocol>
      Header:DUXWidgetCollectionViewController.h
      Inherits From:UIViewController
      Description:

      A base widget collection view controller to manage a standard widget collection.

      Class Members:
      property preferredCameraIndex
      @property (nonatomic) NSUInteger preferredCameraIndex
      Header:DUXWidgetCollectionViewController.h
      Description:

      Selects which camera index widget refers to.

      property widgetCollectionView
      @property (nonatomic, strong, nullable) IBOutlet __kindof UICollectionView <DUXWidgetCollectionViewProtocol> *widgetCollectionView
      Header:DUXWidgetCollectionViewController.h
      Description:

      The view acting as the widget collection.

      See Also:

      DUXWidgetCollectionViewProtocol

      method installMainView
      - (void)installMainView:(nonnull UIView *)view
      Header:DUXWidgetCollectionViewController.h
      Description:

      Places the MainView of the VC as a full size subview of base view..

      Input Parameters:
      nonnull UIView * viewThe view being installed as the main view.
      method widgetItemAtIndex
      - (nullable DUXWidgetItem *)widgetItemAtIndex:(NSInteger)index
      Header:DUXWidgetCollectionViewController.h
      Description:

      returns the widget item at the passed index.

      Input Parameters:
      NSInteger indexThe index of the desired widget item contained inside the view.
      Return:
      nullable DUXWidgetItem *a widget or nil
      method widgetWithClass
      - (nullable UIView<DUXWidgetProtocol> *)widgetWithClass:(nonnull Class)widgetClass
      Header:DUXWidgetCollectionViewController.h
      Description:

      returns the first widget with the passed class.

      Input Parameters:
      nonnull Class widgetClassThe class of the desired widget item contained inside the view.
      Return:
      nullable UIView<DUXWidgetProtocol> *a widget or nil
      method insertWidget:atIndex
      - (void)insertWidget:(nonnull UIView <DUXWidgetProtocol> *)widget atIndex:(NSUInteger)destinationIndex
      Header:DUXWidgetCollectionViewController.h
      Description:

      inserts the widget at the passed index.

      Input Parameters:
      nonnull UIView <DUXWidgetProtocol> * widgetThe widget item being inserted inside the view.
      NSUInteger destinationIndexThe desired index of the widget being inserted.
      method insertWidget:withEdgeInset:atIndex
      - (void)insertWidget:(nonnull UIView <DUXWidgetProtocol> *)widget withEdgeInset:(UIEdgeInsets)edgeInset atIndex:(NSUInteger)destinationIndex
      Header:DUXWidgetCollectionViewController.h
      Description:

      Insert the passed widgets at the given index and applies the edge inset.

      Input Parameters:
      nonnull UIView <DUXWidgetProtocol> * widgetThe widget item being inserted inside the view.
      UIEdgeInsets edgeInsetThe edge inset of the widget item being inserted.
      NSUInteger destinationIndexThe desired index of the widget being inserted.
      method moveWidget:toIndex
      - (void)moveWidget:(nonnull UIView <DUXWidgetProtocol> *)widget toIndex:(NSUInteger)destinationIndex
      Header:DUXWidgetCollectionViewController.h
      Description:

      Moves the widget to another index.

      Input Parameters:
      nonnull UIView <DUXWidgetProtocol> * widgetThe widget item being moved.
      NSUInteger destinationIndexThe desired new index of the widget item.
      protocol DUXWidgetCollectionViewControllerProtocol
      @protocol DUXWidgetCollectionViewControllerProtocol <NSObject>
      Header:DUXWidgetCollectionViewControllerProtocol.h
      Inherits From:NSObject
      Description:

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

      Protocol Methods:
      property widgetCollectionView
      @property (strong, nonatomic, nullable) __kindof UIView<DUXWidgetCollectionViewProtocol> *widgetCollectionView
      Header:DUXWidgetCollectionViewControllerProtocol.h
      Description:

      The actual instance of the widget collection.

      See Also:

      DUXWidgetCollectionViewProtocol

      method
      method addWidget
      @required
      - (void)addWidget:(nonnull UIView <DUXWidgetProtocol> *)newWidget
      Header:DUXWidgetCollectionViewControllerProtocol.h
      Description:

      Adds the passed widget to the collection.

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

      Adds the passed widget to the collection and applies the given edge insets.

      Input Parameters:
      nonnull UIView <DUXWidgetProtocol> * newWidgetThe widget item being added.
      UIEdgeInsets edgeInsetThe widget item.
      method widgetsCount
      @required
      - (NSUInteger)widgetsCount
      Header:DUXWidgetCollectionViewControllerProtocol.h
      Description:

      The number of widgets currently in the collection.

      Return:
      NSUIntegerthe count of widgets
      method indexOfWidget
      @required
      - (NSInteger)indexOfWidget:(nonnull UIView <DUXWidgetProtocol> *)widget
      Header:DUXWidgetCollectionViewControllerProtocol.h
      Description:

      The index of the passed widget.

      Input Parameters:
      nonnull UIView <DUXWidgetProtocol> * widgetThe widget item whose index is returned.
      Return:
      NSIntegeran index
      method widgetAtIndex
      @required
      - (nullable UIView <DUXWidgetProtocol> *)widgetAtIndex:(NSInteger)index
      Header:DUXWidgetCollectionViewControllerProtocol.h
      Description:

      Returns the widget at the passed index.

      Input Parameters:
      NSInteger indexThe index of the widget item returned.
      Return:
      nullable UIView <DUXWidgetProtocol> *a widget or nil
      method removeWidget
      @required
      - (void)removeWidget:(nonnull UIView <DUXWidgetProtocol> *)oldWidget
      Header:DUXWidgetCollectionViewControllerProtocol.h
      Description:

      Removes the passed widget.

      Input Parameters:
      nonnull UIView <DUXWidgetProtocol> * oldWidgetThe previous widget.