> For the complete documentation index, see [llms.txt](https://docs.dataswyft.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.dataswyft.com/build/advanced-topics/pda-authentication/password-management/tutorials/ios-swift.md).

# 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.
