Yo19
Yo19

Reputation: 223

How to use a vapor API in a swift iOS app

I am trying to figure out how to use my vapor API. What i have seen online and everywhere is mostly creating a website using vapor, but what I haven't been able to see is how to use an API I built with an app I am building. what I want to do is create a mobile app that uses a vapor API that I built myself. I have the API, the problem that i am having is creating the iOS swift app to go along with it.

I have seen all the example API and swift apps that vapor has on their GitHub, but they are very confusing to understand for me because they have probably 100 controllers and models. I have been creating practice vapor API, and I know they work because I have been testing them on {ostman, it is just that next step that is confusing me.

If it helps, here is a hypothetical. If I have a simple test API that is using a MySQL database that has database that has an id number, names of famous celebrities, and famous quotes they have said. I want to create a swift iOS app that is just a tableview that shows all the celebrity names that i have on my database and when that name is pressed a list of all the quotes appears.

I am sorry for being very repetitive, but I just wanted to be as clear as possible. If I may ask, please be specific with the help.

Upvotes: 1

Views: 599

Answers (1)

0xTim
0xTim

Reputation: 5565

Essentially your iOS does exactly the same as Postman - it's just a different client. You can use URLSession or Alamofire to make requests to your API as you have been doing in Postman to consume that API.

Upvotes: 2

Related Questions