
Models: This contains various models used in the project.Migrations: This has migrations for Acronym, Category and User as well as a migration to seed the database with initial data.Middlewares: This contains a custom middleware, TILErrorMiddleware, that encodes the custom TILError to a JSON response.Controllers: This directory contains all API controllers to get or create acronyms, categories and users.While you wait for the SwiftPM to resolve dependencies, check out the existing project in Sources/App: Double-click Package.swift to open the Vapor app in Xcode. Navigate to til-vapor-backend within starter package. As long as you use the same encoders and decoders on both ends, thanks to Codable, they’ll work. You can send and receive them with JSON, Protobuf or even XML. If you use the same models on iOS and the server, you don’t need to worry about how the apps send the models in requests. Sharing models is especially beneficial with Swift. For example, when you fix a bug in business logic or add a new property to a model, it’s fixed in both apps. Sharing code between your client and server reduces duplication and means you only have to make changes in one place. There are three relevant models in the project: You can create acronyms in the TIL app so you can remember their meaning. The projects for this tutorial are based on the TIL app from the Server-Side Swift with Vapor book. til-ios-app: The iOS app to consume the API.til-vapor-backend: The Vapor project for the API.The starter project contains two applications: Start by clicking the Download Materials button at the top or bottom of this tutorial. See Getting Started with Server-Side Swift with Vapor 4 if you’re new to Vapor.


Additionally, you should have some experience using Vapor to build web apps.
SWIFT SHARE IOS HOW TO
See Docker on macOS: Getting Started to learn more about Docker and how to install it. Note: This tutorial assumes you’ve installed Docker and have some basic experience with it.
