iOS Developer Library

Developer

StoreKit Framework Reference SKProduct Class Reference

Options
Deployment Target:

On This Page
Language:

SKProduct

SKProduct objects are returned as part of an SKProductsResponse object. Each product object provides information about a product you previously registered in iTunes Connect.

  • A description of the product. (read-only)

    Declaration

    Swift

    var localizedDescription: String { get }

    Objective-C

    @property(nonatomic, readonly) NSString *localizedDescription

    Discussion

    The description is localized based on the currentLocale property.

    Availability

    Available in iOS 3.0 and later.

  • The name of the product. (read-only)

    Declaration

    Swift

    var localizedTitle: String { get }

    Objective-C

    @property(nonatomic, readonly) NSString *localizedTitle

    Discussion

    The description is localized based on the currentLocale property.

    Availability

    Available in iOS 3.0 and later.

  • The cost of the product in the local currency. (read-only)

    Declaration

    Swift

    var price: NSDecimalNumber { get }

    Objective-C

    @property(nonatomic, readonly) NSDecimalNumber *price

    Discussion

    Your application can format the price using a number formatter, as shown in the following sample code:

    1. NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init];
    2. [numberFormatter setFormatterBehavior:NSNumberFormatterBehavior10_4];
    3. [numberFormatter setNumberStyle:NSNumberFormatterCurrencyStyle];
    4. [numberFormatter setLocale:product.priceLocale];
    5. NSString *formattedString = [numberFormatter stringFromNumber:product.price];

    Availability

    Available in iOS 3.0 and later.

    See Also

    priceLocale

  • The locale used to format the price of the product. (read-only)

    Declaration

    Swift

    var priceLocale: NSLocale { get }

    Objective-C

    @property(nonatomic, readonly) NSLocale *priceLocale

    Availability

    Available in iOS 3.0 and later.

    See Also

    price

  • The string that identifies the product to the Apple App Store. (read-only)

    Declaration

    Swift

    var productIdentifier: String { get }

    Objective-C

    @property(nonatomic, readonly) NSString *productIdentifier

    Availability

    Available in iOS 3.0 and later.

  • A Boolean value that indicates whether the App Store has downloadable content for this product. (read-only)

    Declaration

    Swift

    var downloadable: Bool { get }

    Objective-C

    @property(nonatomic, readonly, getter=isDownloadable) BOOL downloadable

    Discussion

    You can associate a set of data files with the iTunes Connect record you created for a product. The value of this property is YEStrue if at least one file has been associated with the product.

    Availability

    Available in iOS 6.0 and later.

  • The lengths of the downloadable files available for this product. (read-only)

    Declaration

    Swift

    var downloadContentLengths: [NSNumber] { get }

    Objective-C

    @property(nonatomic, readonly) NSArray <NSNumber *> *downloadContentLengths

    Discussion

    The array holds NSNumber objects, each of which holds a long long value that is the size of one of the downloadable files (in bytes).

    Availability

    Available in iOS 6.0 and later.

  • A string that identifies which version of the content is available for download. (read-only)

    Declaration

    Swift

    var downloadContentVersion: String { get }

    Objective-C

    @property(nonatomic, readonly) NSString *downloadContentVersion

    Discussion

    The version string is formatted as a series of integers separated by periods.

    Availability

    Available in iOS 6.0 and later.