Bite-sized videos on iOS development.
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.
Up to date with Xcode 15 and iOS 17
UIKit, SwiftUI, SwiftData, and macOS
Swift Language
High Quality Videos
Short and Focused
Any Device
Team Plans
Have I mentioned lately how awesome NSScreencast is? No? Worth the subscription. Check it out if you’re an iOS developer. Or even if you’re not and you want an example of how to do coding screencasts well.
Got tired of dead-end googling so I checked to see if @NSScreencast had covered what I was looking for. Of course he had, 4 years ago. Should have checked there first.
One 13-minute episode of @NSScreencast just paid for the yearly subscription fee in amount of time saved. Do it.
Seriously great stuff even for seasoned developers. I’ve learned a good amount from Ben’s videos.
You can really expand your development horizons in just a few minutes a week with NSScreencast.
Random PSA for iOS developers: @NSScreencast is a great resource, and worth every penny. It’s high quality, practical, and honest.
Can’t say enough good things about @NSScreencast There is gold in the Road Trip DJ Series.
I just reuppped my subscription to @NSScreencast. [An] indespensible resource if you’re into iOS or Mac Development.
Just finished @NSScreencast series on Modern CollectionViews. Strongly recommended. Programmatic UI, nicely structured code, easily approachable explanation style. 👌
#583
In this episode we will introduce Vapor's Queues package and use Redis as our backing storage engine. The performance characteristics of Redis make it a great choice to store work to be processed later. We'll then set up an EmailJob to send a welcome email to new users. We'll also explore how to run these in-process in development as well as separate processes for production. As a final bonus, we'll create a custom Vapor command to test this all out to see how it behaves with many jobs enqueued.
#582
Redis is a popular choice for a key-value store for backend applications. This can be used for a multitude of different reasons, such as caching with automatic expiration, rate limiting based on ip address, leaderboards, pub/sub and much more. Its performance characteristics make it a fantastic choice for queuing systems, which we'll cover soon. In this episode we will set up a redis server in our docker compose file, then integrate it into our Vapor application with a simple middleware to count the number of requests to a given path.
#581
In this episode we will explore supporting JSON Web Tokens, or JWTs. These are a common standard for use in authentication tokens which allows you to support 3rd party authentication providers, token expiration, user metadata and more. These are cryptographically signed and can be verified by the server with a secret. There is also the option to use RSA public/private key pairs to allow clients to verify tokens without going back to the server that signed them. For these reasons JWTs are a really powerful option. Here we will use the Vapor JWT package to provide support for generating and authenticating with HS256 tokens.
#580
In this episode we will explore how to use AsyncRequestAuthenticator types, such as AsyncBasicAuthenticator and AsyncBearerAuthenticator. We’ll see how to compose these to support multiple authentication strategies and how to protect certain routes to require authenticated users.
#579
This episode will introduce a new model for a User that will contain validations to ensure the email address format is correct (using a built-in regular expression) and that the password length is good and secure. We'll also ensure to hash the password with bcrypt before storing it in the database. Finally we'll make a custom Response model for our User so that we don't reveal internal fields to clients.
#578
In this episode, we create a form to create songs from our API by implementing a create route. We use a payload struct to normalize and validate user input for song title and artist name. We also ensure that duplicate artists are not created by using a custom comparison method. Finally, we create the artist and song in the database and return the newly created song. We also configure the JSON output to use snake case instead of camelcase for our default encoder and decoder for our Vapor app.
#577
In this episode, we explore Vapor routing more deeply. We set up a route to fetch a band by its slug, handling async operations and errors. After testing, we refactor with a findBySlug method for reusability. We add a route to fetch songs for a band and discuss avoiding inefficient querying. To organize the code, we create BandsController and SongsController to group routes.
#576
Now that we have our database setup, we can create our models. We'll start by examining the Model and Content protocols, then implement the necessary properties decorated with Fluent's property wrappers to denote primary keys, fields, and foreign keys.
#575
In order to evolve a persistent store over time you have to migrate the data. Fluent, the Vapor Framework that offers ORM support for popular databases, has a solution for this. In this episode we will understand how to write migrations, how to revert them and how to evolve your schema over time without losing data.
#574
Docker is a common choice for running services locally for development as well as server deployment. Vapor comes by default with a working Docker setup, so in this video we will explore how this all works. We'll also explore how to configure the database with Environment variables.
#373
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.
#372
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.
#371
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.
#370
We continue our mini-project to create a Swift script that automatically creates migrations for Vapor projects. In this episode we save the generated templates to disk, render a generated extension so that we can add these migration types to the Vapor service, and see the example running end-to-end.
#369
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.
#368
Usually I lean on Ruby or Bash for writing command line scripts, but it is becoming increasingly more viable to use Swift for this as well. In the Vapor series, I wanted to write a little script (in Swift) that would generate migration files for me so I wouldn’t have to maintain this myself. For this, I used the Marathon tool, which helps alleviate some of the machinery necessary to use Swift in this way. And what better way to explore this tool than with this author guiding me along. John Sundell joins me in this episode to use Marathon and Swift to write a useful script for Vapor applications. This is a longer episode, so it is split into two parts. Enjoy!
#365
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.
#364
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.
#363
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.
#362
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.
#359
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.
#358
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.
#357
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.
#354
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.