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:
-
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).
-
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
Explore Swift performance
Discover how Swift balances abstraction and performance. Learn what elements of performance to consider and how the Swift optimizer affects them. Explore the different features of Swift and how they’re implemented to further understand the tradeoffs available that can impact performance.
Explore App Store server APIs for In-App Purchase
Learn how to leverage your server to build great In-App Purchase experiences with the latest updates to the App Store Server API, App Store Server Notifications, and the open source App Store Server Library. After a recap of current APIs, we’ll introduce updated endpoint functionality, new transaction fields, and a new notification type. We’ll also discuss best practices for the purchase lifecycle, delivering content, and targeting offers, so you can become a server power user.
Consume noncopyable types in Swift
Get started with noncopyable types in Swift. Discover what copying means in Swift, when you might want to use a noncopyable type, and how value ownership lets you state your intentions clearly.