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.

Inheritance


Conforms To


Import Statement


Swift

import StoreKit

Objective-C

@import StoreKit;

Availability


Available in iOS 3.0 and later.
  • 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.

    Import Statement

    Objective-C

    @import StoreKit;

    Swift

    import StoreKit

    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.

    Import Statement

    Objective-C

    @import StoreKit;

    Swift

    import StoreKit

    Availability

    Available in iOS 3.0 and later.

  • price price Property

    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:

    • NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init];
    • [numberFormatter setFormatterBehavior:NSNumberFormatterBehavior10_4];
    • [numberFormatter setNumberStyle:NSNumberFormatterCurrencyStyle];
    • [numberFormatter setLocale:product.priceLocale];
    • NSString *formattedString = [numberFormatter stringFromNumber:product.price];

    Import Statement

    Objective-C

    @import StoreKit;

    Swift

    import StoreKit

    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

    Import Statement

    Objective-C

    @import StoreKit;

    Swift

    import StoreKit

    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

    Import Statement

    Objective-C

    @import StoreKit;

    Swift

    import StoreKit

    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.

    Import Statement

    Objective-C

    @import StoreKit;

    Swift

    import StoreKit

    Availability

    Available in iOS 6.0 and later.

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

    Declaration

    Swift

    var downloadContentLengths: [AnyObject]! { get }

    Objective-C

    @property(nonatomic, readonly) NSArray *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).

    Import Statement

    Objective-C

    @import StoreKit;

    Swift

    import StoreKit

    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.

    Import Statement

    Objective-C

    @import StoreKit;

    Swift

    import StoreKit

    Availability

    Available in iOS 6.0 and later.