An instance of the NKLibrary class represents the library of issues for a newsstand content application.


class NKLibrary : NSObject


You create and add issues to the library by calling the addIssue(withName:date:) method. and remove them from the library by calling the removeIssue(_:) method. You can access all issues through the issues property or request a specific issue by calling the issue(withName:) method. For more information about the objects representing issues, see NKIssue.

The downloadingAssets array holds any downloading assets for any issues. (A downloading asset is represented by a NKAssetDownload object.) A newsstand content application should, when it launches, iterate through this array and call download(with:) on each item to have the downloaded assets completely processed.

An application can maintain as many back issues of the library as it wants, in addition to the most current issue. The Newsstand Kit framework uses the dates of issues and whatever issue is assigned to the currentlyReadingIssue property as hints in low disk space scenarios.


Getting the Shared Library Instance

class func shared() -> NKLibrary?

Returns the shared instance representing the newsstand content library.

Managing Library Issues

func addIssue(withName: String, date: Date) -> NKIssue

Creates a newsstand issue and adds it to the content library.

var currentlyReadingIssue: NKIssue?

Accesses or sets the newsstand issue that the user is currently reading.

func removeIssue(NKIssue)

Removes the specified issue from the newsstand content library.

func issue(withName: String) -> NKIssue?

Returns an issue of the newsstand content library specified by name.

var issues: [NKIssue]

Returns the current issues of the newsstand content library.

Accessing Downloading Assets

var downloadingAssets: [NKAssetDownload]

The assets that are currently being downloaded for one or more issues of the newsstand content library.


Inherits From

Conforms To