DBFILESMediaInfo

Objective-C

@interface DBFILESMediaInfo : NSObject <DBSerializable, NSCopying>

Swift

class DBFILESMediaInfo : NSObject, DBSerializable, NSCopying

The MediaInfo union.

This class implements the DBSerializable protocol (serialize and deserialize instance methods), which is required for all Obj-C SDK API route objects.

Instance fields

  • tag

    Represents the union’s current tag state.

    Declaration

    Objective-C

    @property (nonatomic, readonly) DBFILESMediaInfoTag tag;

    Swift

    var tag: DBFILESMediaInfoTag { get }
  • The metadata for the photo/video. - note: Ensure the isMetadata method returns true before accessing, otherwise a runtime exception will be raised.

    Declaration

    Objective-C

    @property (nonatomic, readonly) DBFILESMediaMetadata *_Nonnull metadata;

    Swift

    var metadata: DBFILESMediaMetadata { get }

Constructors

  • Initializes union class with tag state of “pending”.

    Description of the “pending” tag state: Indicate the photo/video is still under processing and metadata is not available yet.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithPending;

    Swift

    init(pending: ())

    Return Value

    An initialized instance.

  • Initializes union class with tag state of “metadata”.

    Description of the “metadata” tag state: The metadata for the photo/video.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithMetadata:
        (nonnull DBFILESMediaMetadata *)metadata;

    Swift

    init(metadata: DBFILESMediaMetadata)

    Parameters

    metadata

    The metadata for the photo/video.

    Return Value

    An initialized instance.

Tag state methods

  • Retrieves whether the union’s current tag state has value “pending”.

    Declaration

    Objective-C

    - (BOOL)isPending;

    Swift

    func isPending() -> Bool

    Return Value

    Whether the union’s current tag state has value “pending”.

  • Retrieves whether the union’s current tag state has value “metadata”.

    Note

    Call this method and ensure it returns true before accessing the metadata property, otherwise a runtime exception will be thrown.

    Declaration

    Objective-C

    - (BOOL)isMetadata;

    Swift

    func isMetadata() -> Bool

    Return Value

    Whether the union’s current tag state has value “metadata”.

  • Retrieves string value of union’s current tag state.

    Declaration

    Objective-C

    - (nonnull NSString *)tagName;

    Swift

    func tagName() -> String

    Return Value

    A human-readable string representing the union’s current tag state.