iOS Developer Library

Developer

StoreKit Framework Reference SKRequestDelegate Protocol Reference

Options
Deployment Target:

On This Page
Language:

SKRequestDelegate

Inheritance


Not Applicable

Import Statement


Swift

import StoreKit

Objective-C

@import StoreKit;

Availability


Available in iOS 3.0 and later.

The SKRequestDelegate protocol declares common methods that are implemented by delegates for any subclass of the SKRequest abstract class.

  • Called when the request has completed.

    Declaration

    Swift

    optional func requestDidFinish(_ request: SKRequest!)

    Objective-C

    - (void)requestDidFinish:(SKRequest *)request

    Parameters

    request

    The request that completed.

    Discussion

    This method is called after all processing of the request has been completed. Typically, subclasses of SKRequest require the delegate to implement additional methods to receive the response. When this method is called, your delegate receives no further communication from the request and can release it.

    Import Statement

    Objective-C

    @import StoreKit;

    Swift

    import StoreKit

    Availability

    Available in iOS 3.0 and later.

  • Called if the request failed to execute.

    Declaration

    Swift

    optional func request(_ request: SKRequest!, didFailWithError error: NSError!)

    Objective-C

    - (void)request:(SKRequest *)request didFailWithError:(NSError *)error

    Parameters

    request

    The request that failed.

    error

    The error that caused the request to fail.

    Discussion

    When the request fails, your application should release the request. The requestDidFinish: method is not called after this method is called.

    Import Statement

    Objective-C

    @import StoreKit;

    Swift

    import StoreKit

    Availability

    Available in iOS 3.0 and later.