Olivier Halligon 12/15/2018

StringInterpolation in Swift 5 — Introduction

Read Original

This article introduces the redesigned StringInterpolation protocol in Swift 5, as per SE-0228. It explains how to make a type conform to ExpressibleByStringInterpolation by creating a StringInterpolation subtype and implementing custom `appendInterpolation` methods. A practical example demonstrates building a GitHubComment type that formats issue numbers and user mentions within string literals.

StringInterpolation in Swift 5 — Introduction

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser

Top of the Week