Articles, podcasts and news about Swift development, by John Sundell.

Improved compiler errors for auto-synthesized conformances in Xcode 11

Published on 25 Jun 2019
Basics article available: Codable

New in Xcode 11/Swift 5.1: The compiler will now tell you why it can't auto-synthesize conformance to protocols like Encodable and Decodable, instead of just suggesting a manual implementation. Let’s say we have the following type, that we wish to conform to Decodable automatically:

struct ItemMetadata: Decodable {
    var date: Date
    var format: ItemFormat
    var category: String

If the ItemFormat type used above isn’t Decodable, then the compiler will now give us the following error:

Cannot automatically synthesize 'Decodable' because 'ItemFormat'
does not conform to Decodable.

Support Swift by Sundell by checking out this sponsor:


RevenueCat: Easily build and manage iOS and Android in-app purchases. With just a few lines of code RevenueCat provides IAP infrastructure, customer analytics, data integrations, and gives you time back from dealing with edge cases and updates across all platforms.