What is consuming?

Generated on 8/7/2024

1 search

What is consuming?

In the context of WWDC sessions, "consuming" can refer to two different concepts depending on the session:

  1. In-App Purchases:

    • Consumables: These are products that can be used up and repurchased by the customer as desired. An example of a consumable is a pack of 100 gems which can be used to purchase in-game items. The workflow for a consumable purchase begins when the customer buys a consumable in your app. The customer's device receives a signed transaction that your app can then send to your server to validate the transaction and dispense the content. Additionally, the App Store server sends a one-time charge notification to your server with the same information (Explore App Store server APIs for In-App Purchase).
  2. Swift Programming:

    • Consuming Noncopyable Types: In Swift, consuming a variable takes its value, leaving that variable uninitialized. This is particularly relevant for noncopyable types. When a function consumes a parameter, it takes the argument away from its caller, meaning the function will have full ownership of the value and can mutate it. For example, if you have a function that formats a disk, consuming the disk means the function will take ownership of the disk and the caller will no longer have access to it (Consume noncopyable types in Swift).

Relevant Sessions

Session Chapter Markers

  • Explore App Store server APIs for In-App Purchase

    • 0 = Introduction
    • 292 = Purchase lifecycle
    • 831 = Delivering content
    • 1255 = Subscriptions and Offers
  • Consume noncopyable types in Swift

    • 0 = Introduction
    • 30 = Agenda
    • 50 = Copying
    • 425 = Noncopyable Types
    • 710 = Generics
    • 1152 = Extensions
    • 1284 = Wrap up