---
metadata:
  - name: generator
    content: Diplodoc Platform v5.50.3
alternate:
  - https://divkit.tech/docs/en/concepts/quick-start-ios.md
  - https://divkit.tech/docs/ru/concepts/quick-start-ios.md
---
> **Documentation Index:** Fetch the complete configuration index at https://divkit.tech/docs/en/llms.txt

# iOS

To test your code and see a preview of the card on an iOS device, use the DivKit Playground app. You can add the card code in JSON format to the app or open a link to it:

1. Download the DivKit Playground source files from the [repository](https://github.com/divkit/divkit/tree/main/client/ios/DivKitPlayground), compile and install the app on the device.
1. Select **demo**.

1. Add a card using one of the following methods:
    - Insert the code in JSON format or a link to the card prototype in the input field.
    - [Open](https://divkit.tech/docs/en/concepts/quick-start-web.md#web-android) the link from the DivKit Web Playground editor.

    {% note tip "Tip" %}

    To create a card code, you can use the [DivKit Web Playground sample library](https://divkit.tech/playground?samples=1).

    {% endnote %}

1. To view the result, click **show the result**.

## Enhanced Action Reporting

DivKit iOS now provides enhanced context for action reporting through a new method in the `DivReporter` protocol:

```swift
func reportAction(context: DivActionHandlingContext)
```

### New Features

- **Enhanced Context**: Access to additional information about card state and variables
- **Public Structure**: `DivActionHandlingContext` is now available for custom implementations
- **Backward Compatibility**: The old method `reportAction(cardId:info:)` continues to work

### Usage Example

```swift
class CustomReporter: DivReporter {
    func reportAction(context: DivActionHandlingContext) {
        // Access to extended context
        let cardId = context.cardId
        let info = context.info
        let resolver = context.expressionResolver
        
        // Your reporting logic
        print("Action reported for card: \(cardId)")
    }
}
```

{% note info "Backward Compatibility" %}

Existing `DivReporter` implementations continue to work without changes thanks to the default implementation of the new method.

{% endnote %}

<!-- source: en/_includes/index/troubleshooting.md -->
## Learn more {#troubleshooting}

You can discuss topics of interest in the DivKit user community in Telegram: [https://t.me/divkit_community_en](https://t.me/divkit_community_en).



[DivKit Repository](https://github.com/divkit/divkit)
<!-- endsource: en/_includes/index/troubleshooting.md -->

