Shopify
Shopify logoShopify · Feature trail

Swift Struct Copy Function

1 post · Sep 2021

What this trail covers

Shopify has developed and enhanced capabilities for creating immutable objects in Swift, inspired by Kotlin's data class copy function. This involves implementing a functional builder pattern to capture override values, allowing for convenient creation of new struct instances with modified properties while preserving original values. This pattern aims to reduce boilerplate code and improve the adoption of immutability in Swift codebases.

All Shopify trails