> 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="/files/rLPxYTl0RVGuBVU5aG6D" 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
