SE-0229 introduced SIMD types into the Swift Programming language in swift 5. So in today’s post, we will explore the concept of SIMD vector operations, why it is useful, and what performance gains we can achieve by using SIMD when available on the hardware.

Note that the few low-level code examples will be focused on x86 instruction set architectures(ISA) and extensions such as SSE and AVX. But other instruction set architectures like ARM have their own SIMD extensions such as SVE and SVE2. …

Implemented in Swift 4, key paths or smart key paths as it was called in the initial proposal SE-0161, is a feature that allows us to represent references to type properties in a concrete type-safe way and then access those properties dynamically in an instance of a base type.

It works by defining a set of concrete Key Path types that represents the references for the properties and by using a keyPath subscript that allows us to access those properties dynamically.

In today’s post, we are going to do a beginner-friendly overview of the key path feature and how we…

In modern software development, we are having faster iterations, continuous integration, continuous deployment and even daily builds being deployed into production, automated testing has become essential to our project’s workflow in the sense that it makes all this possible by being a validation step which can give us a certain guarantee that we didn’t break some already existing-working flow of the production application with a new patch. Of course, automated tests don’t mean no bugs at all, but in some cases, it can prevent us from deploying a bug into production that is going to impact our clients.

In today’s…

In today’s post, we are going to explore what Kotlin Coroutines are and how they work. This is going to be a high-level overview, so if you want more detail, check out the reference section videos and articles.

Definition

A coroutine is a function that has one or more suspension points. Different from a normal function, which is called, then initializes the local state, executes and terminates. It will have a start, and at each suspension point the function saves the local state (value of variables declared in the scope of that function) and gives the control back to the caller…

SwiftSyntax is a library that provides a Swift abstraction on top of the libSyntax, exposing a set of APIs that makes possible to do things like visiting, rewriting and retrieve information from the syntactic structure of a swift source.
So, in today’s article, we are going to play around and explore a little bit the SwiftSyntax library to understand more about how it works and how we can use to create things that can help us solve some problems.

So, let’s dive in …

The Compiler

Before we dive into the SwiftSyntax, we need to understand at least in a high level…

In today’s post, we are going to talk about the Swift compiler Generic specialization and do a basic overview on what it is and why the SIL Optimizer perform this in order to have a more performant code. Also we will take a brief look on the Swift Intermediate Language (SIL) representation and how it plays out on this generic specialization optimization pass.

First …

The Compiler

Before we dive into the generic specialization, we need to understand at least in a high level some things about the compiler flow.

https://www.draw.io/

The swift compiler takes your Swift code, handles it to a hand-coded…

In today’s article, we are going to talk about a very common issue that we as iOS developers sometimes have to deal with in our development workflow. That problem is how to store our apps production API keys for services that we use, our development, testing or production server URL’s and other data that are maybe too sensitive to be added inside our repository with the code.

Also how to separate the Continuous Integration pipelines to do production, testing or development builds that uses different API keys, access keys, services API address or any of those sensitive data.

There are…

https://giphy.com

In todays article we are going to explore some sorting functions. Those are very common functions that we as developers use in almost all our daily tasks. We will explore some functions like std::sort, std::stable_sort and std::partial_sort of the clang libc++. Also, we are going to take a look on the algorithms behind some of those functions and try to understand how they work. And as a bonus we will talk a bit about the Swift Collection sorting method \o/.

When using a sorting algorithm one of the most important things for us to know is the time complexity. Fortunately…

In this article, we are going to explore a very simple, but very interesting and useful feature of Swift called Autoclosures. If you are not familiar with the concept, the first couple of questions will probably be: What that is? And what makes it different than the “normal” closures?

Well, let's start with the definition from the Swift.org Language guide

An autoclosure is a closure that is automatically created to wrap an expression that’s being passed as an argument to a function. It doesn’t take any arguments, and when it’s called, it returns the value of the expression that’s wrapped…

In Swift we have a very interesting concept that is called Exclusive Access to Memory proposed on SE-176 and implemented in Swift 4. But what that even means? Well, exclusive access is a rule that enforces that every potential modification(write) of variables must be exclusive with any other access to that variable. For example, when working in a multithread environment and we have multiple threads accessing a variable and one or more that can modify this value, we can’t have any access to that from any reader or writer while the variable is already being modified by another writer. …

Luciano Almeida

iOS Developer, Swift and OpenSource enthusiast

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store