StringInterpolation in Swift 5 — AttributedStrings

In the previous post, we introduced the new StringInterpolation design coming to Swift 5. In this second part, I’ll focus on one application of that new ExpressibleByStringInterpolation, to make NSAttributedString prettier.

StringInterpolation in Swift 5 — Introduction

In Swift 4, the StringInterpolation protocol got deprecated, because its original design was inefficient and inflexible, with the goal of redisigning it entirely after Swift 4. Since then, SE-0228 introduced a new design for StringInterpolation, which is going to be part of Swift 5, and opens a whole lot of powerful possibilities.

Private properties in protocols

In Swift, protocols can’t specify access control to the properties they declare. If a property is listed in a protocol, you have to make conforming types declare those properties explicitly.
But sometimes, even if you need those properties in order to provide your implementations, you don’t want those properties to be used outside the type. Let’s see how to workaround that problem.

Exploring @dynamicMemberLookup

With Xcode 10 and Swift 4.2, the new @dynamicMemberLookup proposal is now available in Swift. Let’s have some fun with it.

Using Dedicated Objects as Delegates & Datasources

Today for my come-back post (hopefully), I’ll be talking about a tip for your UITableViewDataSource and UITableViewDelegate. The idea is in fact applicable to a lot of other things following the same delegate pattern, but the use case of UITableView will hopefully be the most concrete example for most people.

SwiftGen 4.2 and other news

SwiftGen — my tool to generate Swift code so you can use your images, localized strings, fonts, storyboards and other assets in a type-safe way — has just been released in version 4.2 after a big internal refactoring. I’ve also been working on other OSS projects lately.

This article intends to give you some news on all those various OSS projects as well as what has been going on lately and what’s next to come.

Still Alive

This is a quick post to reassure you that this blog is still alive 😜 And announcing the subjects that I plan to write about in the upcoming articles.

Talking at conferences

This month, I’m going to talk at (NSSpain and FrenchKit) about Swift 🎉 I’m looking forward to speak for the first time at such great conferences, and I really hope to see you there!

SwiftGen 3

This is a quick announce about the new release of my OpenSource code generation tool SwiftGen 3.0.0.

Closures Capture Semantics, Part 1: Catch them all!

Even with ARC nowadays, it’s still important to understand memory management and objects life-cycles. A special case is when using closures, which are more and more present in Swift and have different capture semantics than ObjC’s block capture rules. Let’s see how they work.