> For the complete documentation index, see [llms.txt](https://docs.verygoodsecurity.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.verygoodsecurity.com/vault/developer-tools/vgs-collect/ios-sdk/samples.md).

# Samples

Examples and references that can help you build your mobile application on top of the VGS Collect iOS SDK.

<figure><img src="https://2096104711-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUreALQAfVnRMQEz110rC%2Fuploads%2Fgit-blob-79a03fc72af9eea8d3b4e5643eeec1c7ed9610f4%2Fvgs-collect-ios-samples.svg?alt=media" alt=""><figcaption></figcaption></figure>

## Demo Applications

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th><th align="center"></th></tr></thead><tbody><tr><td><h4>Demo application</h4></td><td>Demo Application contains the most popular use-cases to configure VGSCollectSDK fields and collect various types of data.</td><td align="center"><a href="https://github.com/verygoodsecurity/vgs-collect-ios/tree/master/demoapp">Open demo</a></td></tr><tr><td><h4>Very Spacy Food</h4></td><td>Showcase Application with full payment flow, from collecting card details with VGSCollectSDK to making payments with third-party providers.</td><td align="center"><a href="https://github.com/vgs-samples/very-spacy-food-ios">Open App</a></td></tr></tbody></table>

## Use Cases

* [Collect Payment Card Details with Card Scanner](https://github.com/verygoodsecurity/vgs-collect-ios/blob/master/demoapp/demoapp/UseCases/CardsDataCollectingViewController.swift)
* [Tokenize Card Details with Vault API v2](https://github.com/verygoodsecurity/vgs-collect-ios/blob/master/demoapp/demoapp/UseCases/CreateCardAliasesViewController.swift)
* [Tokenize Card Details with Vault API v1](https://github.com/verygoodsecurity/vgs-collect-ios/blob/master/demoapp/demoapp/UseCases/CardsDataTokenizationViewController.swift)
* [Customize and Add Supported Payment Card Brands](https://github.com/verygoodsecurity/vgs-collect-ios/blob/master/demoapp/demoapp/UseCases/CustomPaymentCardsViewController.swift)
* [Collect US Social Security Numbers](https://github.com/verygoodsecurity/vgs-collect-ios/blob/master/demoapp/demoapp/UseCases/SSNCollectingViewController.swift)
* [Collect Any Data with custom Validation Rules](https://github.com/verygoodsecurity/vgs-collect-ios/blob/master/demoapp/demoapp/UseCases/CustomDataCollectingViewController.swift)
* [Collect ApplePay Data](https://github.com/verygoodsecurity/vgs-collect-ios/blob/master/demoapp/demoapp/UseCases/CollectApplePayDataViewController.swift)
* [Collect Files](https://github.com/verygoodsecurity/vgs-collect-ios/blob/master/demoapp/demoapp/UseCases/FilePickerViewController.swift)

## SwiftUI

VGS Collect SDK provides  a SwiftUI wrapper around `VGSTextField` and have similar attributes and functionality represented in a SwiftUI way.

* [Collect Card Data in SwiftUI](https://github.com/verygoodsecurity/vgs-collect-ios/blob/master/demoapp/demoapp/UseCases/SwiftUI/CardDataCollectionSwiftUI.swift)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.verygoodsecurity.com/vault/developer-tools/vgs-collect/ios-sdk/samples.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
