Swift

Swift

Swift is a powerful programming language by Apple, used for building both server-side applications and user interfaces with SwiftUI. Explore server-side frameworks like Vapor and Hummingbird, and learn best practices for creating robust backend services.

40 posts

· 3 min read

Running tasks in parallel


Learn how to run tasks in parallel using the old-school tools and frameworks plus the new structured concurrency API in Swift.

· 2 min read

Easy multipart file upload for Swift


Let me show you how to create HTTP requests using multipart (form data) body without a third party library. Simple solution.

· 5 min read

Beginner's guide to modern generic programming in Swift


Learn the very basics about protocols, existentials, opaque types and how they are related to generic programming in Swift.

· 4 min read

Async HTTP API clients in Swift


Learn how to communicate with API endpoints using the brand new SwiftHttp library, including async / await support.

· 4 min read

Beginner's guide to Swift arrays


Learn how to manipulate arrays in Swift like a pro. This tutorial covers lots of useful array related methods, tips and tricks.

· 4 min read

How to use a Swift library in C


In this tutorial, we're going to build a C app by importing a Swift library and talk a bit about the Swift / C Interoperability in general.

· 6 min read

Building tree data structures in Swift


This tutorial is about showing the pros and cons of various Swift tree data structures using structs, enums and classes.

· 9 min read

Practical guide to binary operations using the UInt8 type in Swift


Introduction to the basics of signed number representation and some practical binary operation examples in Swift using UInt8.

· 6 min read

All about the Bool type in Swift


Learn everything about logical types and the Boolean algebra using the Swift programming language and some basic math.

· 5 min read

How to build better command line apps and tools using Swift?


These tips will help you to create amazing CLI tools, utility apps, server side projects or terminal scripts using the Swift language.

· 9 min read

Swift structured concurrency tutorial


Learn how to work with the Task object to perform asynchronous operations in a safe way using the new concurrency APIs in Swift.

· 9 min read

Swift actors tutorial - a beginner's guide to thread safe concurrency


Learn how to use the brand new actor model to protect your application from unwanted data-races and memory issues.

· 5 min read

Introduction to async/await in Swift


Beginners guide to the new async/await API's in Swift 5.5. Interacting with sync code, structured concurrency, async let.

· 7 min read

Dynamic libraries and code replacements in Swift


How to load a dynamic library and use native method swizzling in Swift? This article is all about the magic behind SwiftUI previews.

· 8 min read

Unsafe memory pointers in Swift


Learn how to use raw pointer references, interact with unsafe pointers and manually manage memory addresses in Swift.

· 8 min read

Memory layout in Swift


Start learning about how Swift manages, stores and references various data types and objects using a memory safe approach.

· 6 min read

How to use C libraries in Swift?


Learn how to use system libraries and call C code from Swift. Interoperability between the Swift language and C for beginners.

· 8 min read

Building static and dynamic Swift libraries using the Swift compiler


This tutorial is all about emitting various Swift binaries without the Swift package manager, but only using the Swift compiler.

· 6 min read

The Swift compiler for beginners


Learn how to build executable files using the swiftc command, meet the build pipeline, compilers and linkers under the hood.

· 5 min read

Event-driven generic hooks for Swift


In this article I am going to show you how to implement a basic event processing system for your modular Swift application.

· 9 min read

Getting started with SwiftIO


SwiftIO is an electronic circuit board that runs Swift on the bare metal. It can control sensors, displays, lights, motors and more.

· 6 min read

Logging for beginners in Swift


Learn how to print variables to the debug console using different functions such as print, dump, NSLog and the unified os.log API.

· 6 min read

How to define strings, use escaping sequences and interpolations?


As a beginner it can be hard to understand String interpolation and escaping sequences, in this tutorial I'll teach you the basics.

· 4 min read

Building and loading dynamic libraries at runtime in Swift


Learn how to create a plugin system using dynamic libraries and the power of Swift, aka. modular frameworks on the server-side.

· 5 min read

What's new in Swift 5.3?


Swift 5.3 is going to be an exciting new release. This post is a showcase of the latest Swift programming language features.

· 7 min read

The Swift package manifest file


This article is a complete Swift Package Manager cheatsheet for the package manifest file, using the latest Swift 5.2 tools version.

· 12 min read

How to download files with URLSession using Combine Publishers and Subscribers?


Learn how to load a remote image into an UIImageView asynchronously using URLSessionDownloadTask and the Combine framework in Swift.

· 7 min read

Promises in Swift for beginners


Everything you ever wanted to know about futures and promises. The beginner's guide about asynchronous programming in Swift.

· 9 min read

Beginners guide to functional Swift


The one and only tutorial that you'll ever need to learn higher order functions like: map, flatMap, compactMap, reduce, filter and more.

· 7 min read

How to use the result type to handle errors in Swift 5?


From this tutorial you can learn how to utilize the do-try-catch syntax with the brand new result type to handle errors in Swift.

· 3 min read

Swift 5 and ABI stability


Apple's Swift 5 language version will be a huge milestone for the developer community, let's see what are the possible benefits of it.

· 6 min read

Generating random numbers in Swift


Learn everything what you'll ever need to generate random values in Swift using the latest methods and covering some old techniques.

· 11 min read

Ultimate Grand Central Dispatch tutorial in Swift


Learn the principles of multi-threading with the GCD framework in Swift. Queues, tasks, groups everything you'll ever need I promise.

· 1 min read

How to parse JSON in Swift using Codable protocol?


In this Swift tutorial, I'd like to give you an example about getting and parsing JSON data using URLSession and Codable protocol.

· 11 min read

Deep dive into Swift frameworks


Learn everything about Swift modules, libraries, packages, closed source frameworks, command line tools and more.

· 3 min read

How to call C code from Swift


Interacting with C libraries from the Swift language is really amazing, from this post can learn the most of C interoperability.

· 2 min read

How to make a Swift framework?


Creating a Swift framework shouldn't be hard. This tutorial will help you making a universal framework for complex projects.

· 1 min read

Swift enum all values


In this quick tutorial I'll show you how to get all the possible values for a Swift enum type with a generic solution written in Swift.

· 12 min read

Result builders in Swift


If you want to make a result builder in Swift, this article will help you to deal with the most common cases when creating a DSL.

· 6 min read

Everything about public and private Swift attributes


Have you ever heard about Swift language attributes? In this article I'm trying to gather all the @ annotations and their meanings.