DKReaction

@objc(DKReaction)
public final class DKReaction : NSObject, NSCoding, DKResponseObjectSerializable, DKResponseListSerializable

Reactions are essentially a way for a user to “Like” an item.

  • id

    The unique identifier of the reaction

    Declaration

    Swift

    public var id: NSNumber
  • The unique identifier for the associated item

    Declaration

    Swift

    public var itemID: NSNumber
  • The name of the associated item

    Declaration

    Swift

    public var itemName: String?
  • The unique identifier of the parent collection

    Declaration

    Swift

    public var collectionID: NSNumber?
  • The name of the parent collection

    Declaration

    Swift

    public var collectionName: String?
  • The date the reaction was created

    Declaration

    Swift

    public var createdAt: Date
  • The date the reaction was last updated

    Declaration

    Swift

    public var updatedAt: Date?
  • The creator of the reaction

    Declaration

    Swift

    public var user: DKUser?

DKResponseObjectSerializable

  • Serializes a new instance from the provided network response and key-value representation. The representation is validated for the required parameters, then fills in optional parameters as necessary.

    Declaration

    Swift

    public init?(response: HTTPURLResponse, representation: Any)

    Parameters

    response

    A network response assocated with serialization

    representation

    A key-value object representing parameters and child objects.

NSCoding

  • Returns an object initialized from data in a given unarchiver.

    • Discussion: You typically return self from init(coder:). If you have an advanced need that requires substituting a different object after decoding, you can do so in awakeAfter(using:).

    Declaration

    Swift

    public required init?(coder aDecoder: NSCoder)

    Parameters

    coder

    An unarchiver object.

    Return Value

    self, initialized using the data in coder.

  • Encodes the receiver using a given archiver.

    Declaration

    Swift

    public func encode(with aCoder: NSCoder)

    Parameters

    encoder

    An archiver object.