iOS Developer Library

Developer

NewsstandKit Framework Reference NKIssue Class Reference

Options
Deployment Target:

On This Page
Language:

NKIssue

Inherits From


Conforms To


Import Statement


Swift

import NewsstandKit

Objective-C

@import NewsstandKit;

Availability


Available in iOS 5.0 and later

An instance of the NKIssue class represents an issue of a newsstand content application.

An NKIssue object must have a name and a date. When you create the object using the addIssueWithName:date: method of the NKLibrary class, you must supply these two values. In addition, an NKIssue object can be associated with one or more assets that are downloading. These assets are represented by NKAssetDownload objects, which you create and associate with the issue by calling the addAssetWithRequest: method. If there are downloading assets, the NKIssue object has a status of NKIssueContentStatusDownloading.

As assets are being downloaded for an issue, you should put the processed (for example, unarchived or assembled) issue assets in the sandbox file-system location identified by contentURL. After all downloads of assets for an issue have completed, NKIssue posts the NKIssueDownloadCompletedNotification notification which objects in an application can observe.

  • Adds an asset to the list of assets to be downloaded and returns an instance representing that asset.

    Declaration

    Swift

    func addAssetWithRequest(_ request: NSURLRequest!) -> NKAssetDownload!

    Objective-C

    - (NKAssetDownload *)addAssetWithRequest:(NSURLRequest *)request

    Parameters

    request

    An object representing a URL request.

    Return Value

    An instance of NKAssetDownload, which represents an issue asset that can be downloaded from the application’s server. Returns nil if there a problem creating the object.

    Discussion

    You must send downloadWithDelegate: to the returned object to begin the downloading of the asset.

    Import Statement

    Objective-C

    @import NewsstandKit;

    Swift

    import NewsstandKit

    Availability

    Available in iOS 5.0 and later

  • Returns the assets that are currently downloading for the newsstand issue. (read-only)

    Declaration

    Swift

    var downloadingAssets: [AnyObject]! { get }

    Objective-C

    @property(readonly, copy) NSArray *downloadingAssets

    Discussion

    Each item in the returned array is an instance of NKAssetDownload. If there are any downloading assets for the issue, the representing NKIssue object has a status of NKIssueContentStatusDownloading.

    Import Statement

    Objective-C

    @import NewsstandKit;

    Swift

    import NewsstandKit

    Availability

    Available in iOS 5.0 and later

  • The location in the application sandbox where issue content should be stored. (read-only)

    Declaration

    Swift

    @NSCopying var contentURL: NSURL! { get }

    Objective-C

    @property(readonly, copy) NSURL *contentURL

    Discussion

    The application, after processing downloaded assets, should write the issue content to the filesystem location identified by this property.

    Import Statement

    Objective-C

    @import NewsstandKit;

    Swift

    import NewsstandKit

    Availability

    Available in iOS 5.0 and later

  • status status Property

    The status of the newsstand issue. (read-only)

    Declaration

    Swift

    var status: NKIssueContentStatus { get }

    Objective-C

    @property(readonly) NKIssueContentStatus status

    Discussion

    An issue’s status is either available, downloading, or none. Each of these reflect whether assets are downloading for the issue and if there is issue content at contentURL. See the description of the NKIssueContentStatus type for more information.

    Import Statement

    Objective-C

    @import NewsstandKit;

    Swift

    import NewsstandKit

    Availability

    Available in iOS 5.0 and later

    See Also

    date
    name

  • date date Property

    The date of the newsstand issue. (read-only)

    Declaration

    Swift

    @NSCopying var date: NSDate! { get }

    Objective-C

    @property(readonly, copy) NSDate *date

    Discussion

    This date is provided when the NKIssue instance is created through the addIssueWithName:date: method of NKLibrary.

    Import Statement

    Objective-C

    @import NewsstandKit;

    Swift

    import NewsstandKit

    Availability

    Available in iOS 5.0 and later

    See Also

    status
    name

  • name name Property

    The name of the newsstand issue. (read-only)

    Declaration

    Swift

    var name: String! { get }

    Objective-C

    @property(readonly, copy) NSString *name

    Discussion

    This name is provided when the NKIssue instance is created through the addIssueWithName:date: method of NKLibrary. The name must be unique across all issues in the library.

    Import Statement

    Objective-C

    @import NewsstandKit;

    Swift

    import NewsstandKit

    Availability

    Available in iOS 5.0 and later

    See Also

    status
    date

  • The status of the newsstand issue.

    Declaration

    Swift

    enum NKIssueContentStatus : Int { case None case Downloading case Available }

    Objective-C

    typedef enum { NKIssueContentStatusNone, NKIssueContentStatusDownloading, NKIssueContentStatusAvailable, } NKIssueContentStatus;

    Constants

    • None

      NKIssueContentStatusNone

      Assets are not downloading for the issue and there is no content at contentURL.

      Available in iOS 5.0 and later

    • Downloading

      NKIssueContentStatusDownloading

      The issue has assets that are currently downloading.

      Available in iOS 5.0 and later

    • Available

      NKIssueContentStatusAvailable

      Downloading of assets is not taking place and there is issue content at contentURL.

      Available in iOS 5.0 and later

    Import Statement

    Objective-C

    @import NewsstandKit;

    Swift

    import NewsstandKit

    Availability

    Available in iOS 5.0 and later