An indespensible resource for developers.

Curious? Get 3 great screencasts FREE.

Thousands of developers use NSScreencast to stay on top of iOS development.

Video Training for iOS Developers

The iOS landscape is large and changes often. With short, bite-sized videos released on a steady schedule, NSScreencast helps keep you continually up to date.

  • Quality content This isn't Youtube. Each screencast is carefully produced in HD quality.
  • Team Plans Get access for your whole team. NSScreencast makes for great lunch & learns.
  • Any Device Stream on the web, or use one of our apps for  tv, iPhone, and iPad.
Stay up to date!

Founded in 2012, NSScreencast has been releasing a new screencast each week for more than 6 years. With short videos you can learn a lot over time without a huge time commitment.

NSScreencast offers the largest collection of iOS development screencasts on the internet. With the range of videos that NSScreencast offers, there is something for people of every skill level.

Bite-sized screencasts on iOS and Mac development.

There are 18 episodes with tag 'server side swift'   Clear search
Taking input from a request body in order to update or create a record is extremely easy with Vapor. In this episode we will update our create and update routes for Projects and take in JSON input from the request in order to modify Projects. We also talk about decoupling the request model from our actual model to prevent updating certain internal attributes from being modified.
So far in this series we have been adding all of our routes to the routes.swift file. You can see that this would get unwieldy over time. In this episode we will use RouteCollections to build controllers so that we can organize the routes around the Projects resource. We’ll conform our Project type to the Parameter protocol to make loading models from a route parameter extremely simple, and we will leverage the Content protocol to have the results serialized to JSON automatically.
When you have a many-to-many relationship you typically rely on a join table, or what Vapor calls a Pivot table to relate the records together. In this episode we will create a relationship to allow an issue to have many tags, and also allow a tag to apply to many issues. We'll see how we can use Vapor's ModifiablePivot and Sibling types to make working with these relationships easier.
Our Project and Issue models currently aren't connected in any way. In this episode we will add a foreign key to the projects table and add the parent/child relationships the models so that we can query for issues belonging to a project.
In the last 2 episodes we added some behavior to add automatically managed timestamp fields and some fairly complex logic to set up UUID primary keys the way we want. Now if we want to share those, or make them the default for our models, we currently have to copy & paste. In this episode we will refactor this logic into reusable protocols so that our work can be applied on any model we wish easily.
If you want to track when records are created and modified, you can add some fields to your model and Fluent will automatically manage them for you. You just have to take care to define your TimestampKey properties carefully so they match what Fluent expects.
In this episode we look at customizing the table and columns that Fluent creates for us. In addition to customizing our column data types, we'll also have to lean on an extension of Postgres to generate UUID values for us. We'll see how to customize some of the column constraints to suit our needs, and then create a development route to test it all out.
In this episode we set up a new Vapor application to use Postgresql as the database. We'll see how to configure FluentPostgreSQL, how to create and set up a connection to the database, and look at the defaults for PostgresSQLModel. We'll also discuss the pros and cons of using UUID primary keys over auto-incrementing integers.
In this episode we take a deeper look at one of the fundamental building blocks that support Vapor's asynchronous programming model: Futures. Understanding Futures is really important to understand when writing Vapor applications.
Now that we have Fluent set up, let’s see how we can use it to add, update, and delete records to the database. We’ll get a taste for how futures work in Vapor, and we will also see some of the builtin features that Vapor has to make loading records from your routes really simple.
Most server applications will need to store some data in a database. For Vapor applications, this is done with Fluent, a Swift Object-Relational-Mapper for persisting objects to a database. Fluent supports SQLite, Postgres, and Mysql. In this episode we will learn how to set up Fluent with a SQLite database for development. We'll create our first model object, and discuss how Fluent supports migrations for evolving the database schema over time.
Let's take what we have learned and build a simple web app. We'll leverage NSLinguisticTagger on the server and built a small UI that extracts names from provided text. We'll lean on everything we have used so far in this series: routes, templates, master templates, context data, and a little CSS to make the UI look nice.
When working with web pages, you will almost certainly want to share a considerable amount of HTML. By nesting templates inside of master templates, we can share common HTML structure, layout, and share styles and scripts. We will see how to define sections that can be customized inside of your templates, as well as how to extract common components into partials that you can embed inside of other templates.
Leaf is Vapor's component for rendering dynamic templates. Rather than writing HTML strings by hand in our router, we can write leaf templates that allow us to mix HTML with code. Since Leaf is a separate package, we will show how to integrate this into your project from scratch, to get an overview of how dependencies are assembled in a Vapor project.
Vapor uses a router to determine how to process incoming requests. In this episode, we will see how to define routes and how to return simple responses. We will see how to return custom JSON responses, how to accept JSON posts, and how to deal with requests with dynamic parameters.
In this episode we'll learn how to install the vapor tools, how to create new projects, and look at how projects are structured.
Running Swift on Linux is intriguing because it allows us to create web applications with Swift and host them on an inexpensive Linux VPS. In this episode we'll use Vagrant to create an Ubuntu virtual machine, install a working version of the Swift development snapshot, and write a tiny web application, complete with routing, parameter extraction, template rendering with Stencil, and JSON parsing. You'll learn about Swift Build, specifying version dependencies, and where to look for the source code.
In this episode we talk a look at the cool new world of open source Swift! We'll use vagrant to spin up a Linux virtual machine, then install the latest Swift development snapshot and talk about running the Swift REPL and compiling programs on Linux. Using the latest development snapshot is not without its troubles, however, so you'll see how best to report bugs and/or look for workarounds. Enjoy!