iOS Developer Library

Developer

NewsstandKit Framework Reference NKAssetDownload Class Reference

Options
Deployment Target:

On This Page
Language:

NKAssetDownload

An instance of the NKAssetDownload class represents an asset that is being downloaded (or has downloaded) for an issue of a Newsstand application. More...

Inheritance


Conforms To


Import Statement


import NewsstandKit @import NewsstandKit;

Availability


Available in iOS 5.0 and later.
  • Returns a connection object and starts downloading the issue asset with a specified delegate to handle callbacks.

    Declaration

    Swift

    func downloadWithDelegate(_ delegate: NSURLConnectionDownloadDelegate!) -> NSURLConnection!

    Objective-C

    - (NSURLConnection *)downloadWithDelegate:(id<NSURLConnectionDownloadDelegate>)delegate

    Parameters

    delegate

    A object that adopts the NSURLConnectionDownloadDelegate protocol and implements the methods related to issue-asset downloads.

    Return Value

    An object representing the URL connection.

    Discussion

    Upon receipt of this message, the Newsstand Kit framework creates a NSURLConnection object from the NSURLRequest object encapsulated by the receiver, returns the connection object, and typically begins downloading the issue asset. (If the download is already underway, it simply returns the associated connection object.) It sends messages to the connection-download delegate at the appropriate junctures until the download concludes.

    Import Statement

    import NewsstandKit

    Availability

    Available in iOS 5.0 and later.

  • An identifier for the downloaded asset.

    Declaration

    Swift

    var identifier: String! { get }

    Objective-C

    @property(readonly, copy) NSString *identifier

    Discussion

    A unique string identifier that Newsstand Kit generates and assigns to the asset download.

    Import Statement

    import NewsstandKit

    Availability

    Available in iOS 5.0 and later.

  • userInfo userInfo Property

    Application-specific information that is saved with the asset-download object.

    Declaration

    Swift

    var userInfo: [NSObject : AnyObject]!

    Objective-C

    @property(copy) NSDictionary *userInfo

    Discussion

    This dictionary is for storing arbitrary key-value pairs associated with the asset download. The keys and values must be valid property-list types; if any are not, an exception is raised. Examples of download-related information you might store in the dictionary are the file (issue) name, the download URL, the encoding mechanisms, and custom identifiers. However, for performance reasons the dictionary content should be as minimal as possible. You can also assign nil to this property.

    Import Statement

    import NewsstandKit

    Availability

    Available in iOS 5.0 and later.

    See Also

    identifier

  • The URL request associated with the asset download. (read-only)

    Declaration

    Swift

    @NSCopying var URLRequest: NSURLRequest! { get }

    Objective-C

    @property(readonly, copy) NSURLRequest *URLRequest

    Discussion

    This object was passed into the the addAssetWithRequest: method of NKIssue to create the NKAssetDownload object.

    Import Statement

    import NewsstandKit

    Availability

    Available in iOS 5.0 and later.

    See Also

    identifier
    issue

  • issue issue Property

    The issue associated with the asset download. (read-only)

    Declaration

    Swift

    weak var issue: NKIssue! { get }

    Objective-C

    @property(readonly, weak) NKIssue *issue

    Import Statement

    import NewsstandKit

    Availability

    Available in iOS 5.0 and later.