DKItem
@objc(DKItem)
public final class DKItem : NSObject, NSCoding, DKResponseObjectSerializable, DKResponseListSerializable
Items belong to a collection, can optionally belong to another item (a stack), and have many comments and reactions.
-
The unique identifier of the item
Declaration
Swift
public var id: NSNumber -
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 unique identifier of the parent stack
Declaration
Swift
public var parentID: NSNumber? -
The name of the parent stack
Declaration
Swift
public var parentName: String? -
The name of the item
Declaration
Swift
public var name: String? -
Not to be confused with the
NSObjectdescription, this is the Dropmark-defined description of an itemDeclaration
Swift
public var descriptionText: String? -
Content may contain a multitude of types. Usually the content takes the form of a string, which may in turn represent a URL
Declaration
Swift
public var content: Any? -
A link to the content, external to Dropmark
Declaration
Swift
public var link: URL? -
Undocumented
Declaration
Swift
public var preview: String? -
User-defined thumbnail image URL, if available
Declaration
Swift
public var thumbnail: URL? -
trueif the item is available to share via a linkDeclaration
Swift
public var shareable: Bool? -
The size in bytes, if applicable, of the content
Declaration
Swift
public var size: NSNumber? -
Undocumented
Declaration
Swift
public var sort: NSNumber? -
The high level representation of the content. See the documentation of
DKItemTypefor a richer understanding of when to reference an item’s typeDeclaration
Swift
public var type: DKItemType -
The MIME type as derived by Dropmark
Declaration
Swift
public var mime: String? -
If available, the location the item’s content was created
Declaration
Swift
public var location: CLLocation? -
The date the item was created
Declaration
Swift
public var createdAt: Date -
The date the last time the item was updated
Declaration
Swift
public var updatedAt: Date? -
The date the item was marked for deletion
Declaration
Swift
public var deletedAt: Date? -
The total number of reactions (or “likes”) recieved by the item
Declaration
Swift
public var reactionsTotalCount: NSNumber -
A link to the item on Dropmark. Note: The item must be
shareableto view this link.Declaration
Swift
public var url: URL -
A shortened link to the item on Dropmark. Note: The item must be
shareableto view this link.Declaration
Swift
public var shortURL: URL -
A suite of thumbnails generated by Dropmark
Declaration
Swift
public var thumbnails: DKThumbnails? -
trueif the content contains a URL. Note: Always test the content yourself, use this only for preview/UI renderingDeclaration
Swift
public var isURL: Bool? -
A list of tags applied to this item
Declaration
Swift
public var tags: [DKTag] -
Contains a range of other data associated with the item’s content. For example, an image item may contain the image’s EXIF data as a key-value set
Declaration
Swift
public var metadata: [String : AnyObject]? -
If the item is a stack, this contains a list of child items. Usually this is used to temporarily store up to 4 child items for a quadrant thumbnail, not as a store of all children items.
Declaration
Swift
public var items: [DKItem]? -
If the item is a stack, this is the total number of child items
Declaration
Swift
public var itemsTotalCount: NSNumber? -
The creator of the item
Declaration
Swift
public var user: DKUser -
The reactions (or “likes”) the item recieved
Declaration
Swift
public var reactions: [DKReaction] -
The comments the item recieved
Declaration
Swift
public var comments: [DKComment] -
The effective file path for an item on Dropmark’s servers
Declaration
Swift
public var directory: DKDirectory { get }
-
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
responseA network response assocated with serialization
representationA key-value object representing parameters and child objects.
-
Returns an object initialized from data in a given unarchiver.
Discussion: You typically return
selffrominit(coder:). If you have an advanced need that requires substituting a different object after decoding, you can do so inawakeAfter(using:).
Declaration
Swift
public required init?(coder aDecoder: NSCoder)Parameters
coderAn unarchiver object.
Return Value
self, initialized using the data incoder. -
Encodes the receiver using a given archiver.
Declaration
Swift
public func encode(with aCoder: NSCoder)Parameters
encoderAn archiver object.
View on GitHub
Install in Dash
DKItem Class Reference