DBFILESTag

Objective-C

@interface DBFILESTag : NSObject <DBSerializable, NSCopying>

Swift

class DBFILESTag : NSObject, DBSerializable, NSCopying

The Tag union.

Tag that can be added in multiple ways.

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) DBFILESTagTag tag;

    Swift

    var tag: DBFILESTagTag { get }
  • Tag generated by the user. - note: Ensure the isUserGeneratedTag method returns true before accessing, otherwise a runtime exception will be raised.

    Declaration

    Objective-C

    @property (nonatomic, readonly) DBFILESUserGeneratedTag *_Nonnull userGeneratedTag;

    Swift

    var userGeneratedTag: DBFILESUserGeneratedTag { get }

Constructors

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

    Description of the “user_generated_tag” tag state: Tag generated by the user.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithUserGeneratedTag:
        (nonnull DBFILESUserGeneratedTag *)userGeneratedTag;

    Swift

    init(userGeneratedTag: DBFILESUserGeneratedTag)

    Parameters

    userGeneratedTag

    Tag generated by the user.

    Return Value

    An initialized instance.

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

    Declaration

    Objective-C

    - (nonnull instancetype)initWithOther;

    Swift

    init(other: ())

    Return Value

    An initialized instance.

Tag state methods

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

    Note

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

    Declaration

    Objective-C

    - (BOOL)isUserGeneratedTag;

    Swift

    func isUserGeneratedTag() -> Bool

    Return Value

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

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

    Declaration

    Objective-C

    - (BOOL)isOther;

    Swift

    func isOther() -> Bool

    Return Value

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

  • 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.