# iOS/Swift

## Environment Set-up

### Overview

In order to build an `iOS` app that uses HAT APIs, you first need to install the **HAT for iOS** library from [github](https://github.com/Hub-of-all-Things/HatForIOS). To do so you can either manually download the library and add it to your project via drag n drop or you can use [cocoapods](https://guides.cocoapods.org/using/getting-started.html) and install it *automagically*.

### Requirements

* Xcode 10
* Swift 4+
* This guide does not show you how to set up the UI; you have to be able to design a basic UI in order to make everything work

### Installing **HAT for iOS** library manually

To manually install the library you have to download the repo from github and add it to your project via drag n drop.

### Installing **HAT for iOS** library via Cocoapods

**Step 1**

`(If you are using cocoapods already you can skip this step)`&#x20;

Install cocoapods as described [here](https://guides.cocoapods.org/using/getting-started.html)

**Step 2**

`(If you are using cocoapods already you can skip this step)`&#x20;

If you are **not** using cocoapods in your project you have to initialise pods first. To do so you have to run `pod init` via terminal in the project's root folder. That command will create the necessary files in your project.

**Step 3**

After initializing cocoapods there will be a new podfile file in your project. Open it and add the `HatForIOS` pod in your main target like this:

```swift
pod 'HAT-API-iOS'
```

**Step 4**

Open the terminal again and run `pod install` in the project's root folder. This will install `HatForIOS` pod in your project.

**Step 5**

Remember to **always** run the *.xcworkspace* file and not the *.xcodeproj* file.


---

# Agent Instructions: 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:

```
GET https://docs.dataswyft.com/build/advanced-topics/pda-authentication/password-management/tutorials/ios-swift.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
