Skip to main content


What’s new in Swift is a news feed that focuses on the latest articles, trends, and stories happening around the Swift ecosystem that I find interesting.  All of the topics selected in this article have been cherry picked from either Github,, or found the Swift Forums over the last few weeks and can range from topics covered in iOS, macOS, tvOS, watchOS, or in the Server Side community.  This latest issue focuses on SourceKit-LSP, adding Python 2 and 3 support to the Swift stdlib, a Swift by Sundell Podcast - Episode 38, and the WLAN project PureSwift. 


In years past Apple has announced their new operating systems, developer tools, and environments at WWDC and then in the fall final versions would be released to the entire developer base.  Today, it is a whole new world in that the Swift language has mostly diverged from this pattern and is released on a community driven time schedule.

In mid-December of 2017 a proposal went into review for the Swift language entitled, “SE-0192 – Non-Exhaustive Enums.”  In this proposal the Swift core team outlined a change to allow switch statements that consume enum types to be non-exhaustive or exhaustive, depending upon their needs.   The motivation behind this change was to allow for the easier additions to C based Enums in Apple or third party libraries without creating source breaking changes in projects downstream.

Writing unit testing is a cornerstone of software development.  When developing mobile or desktop applications, unit testing becomes even more critical, as there is often vital business logic that needs to be validated.  Have you ever found yourself wondering; what makes a great unit test in Swift? What key components give my application enough testing coverage to make sure that everything works and nothing regresses when new code is added to my project?  If you have asked yourself these questions then you are not alone.  In fact, that is why I wanted to write this tutorial.

When the Swift language went into development one of the goals it set out to achieve was to provide a better developer experience than the one that currently existed and to provide long term support against legacy C and Objective-C APIs.   Now that these goals have been achieved the Swift community is widening it's support to working with dynamic languages such as Python, Ruby, JavaScript, and Perl in Swift 4.2's language addition for Dynamic Member Lookups.  Providing support for these

Debugging network issues no matter what platform you are on can be challenging.  Often, the deeper you dig into the operating system the harder it can be to analyze and accurately interpret the network traffic you are seeing. And working with iOS is no different.  Debugging iOS traffic from a device to a router or from a device to a server can present many challenges.

A few weeks ago Apple released a new open source framework on GitHub called Swift-NIO.  What is Swift-NIO? The opening line on GitHub describes the project as a cross platform, event driven, non-blocking, application framework to develop high performance networking applications in Swift.  So what does that mean? That means that Apple has developed a foundational project for any application that may need take advantage of an asynchronous networking framework, similar to that of Node.js.

If you are like me and have ever found yourself wondering, "what is the exact syntax on how completion handlers are setup in closures?" Then this tutorial is for you.  I wrote this tutorial with the idea in mind that sometimes it is nice to have a resource to reference when writing and defining completion handlers in your Swift project.  I also wanted to provide a quick reference on how to setup a completion handler as a function and as declared constant.  So all you have to do is make the decision about what makes the most sense in your project.


Have you ever found yourself trying to remember the syntax on how to grab the first few characters from the start or end a string in Swift 4.  Well, I certainly have from time to time and that is why I wanted to write this tutorial. To show you the reader how to grab the first few characters from the start or the end of a Swift string using only two Swift Standard library methods, and from there show one more slightly advanced technique.  So by the end of this tutorial you should be able to get the first few characters from the start or the end of a string in either Swift 3 or 4.

If you are like me and sometimes you forget the syntax on how to sort an object by a custom property then this tutorial is aimed at you.  The goal for this tutorial is to show you how to sort custom objects in Swift by a date property.  But that's not it!  One of the major reasons why the API used in this tutorial is so versatile is because it can also be extended out to other properties on a custom object like a string property, for example.  So by the end of this tutorial you should be able to sort collections of objects by either date or string properties in either Swift 3 or 4.