# A Kotlin Style .copy Function for Swift Structs

DevFeed: [A Kotlin Style .copy Function for Swift Structs](<https://devfeed.tech/articles/a-kotlin-style-copy-function-for-swift-structs-1462.md>)

Original publisher: [Read original article](<https://shopify.engineering/kotlin-style-copy-function-swift-structs>)

Author: Scott Birksted

Published: 2021-09-02T15:00:02Z

Content type: tutorial

Language: en

Sources: [Shopify Engineering](<https://devfeed.tech/sources/shopify-engineering.md>), [Shopify Engineering - Shopify Engineering](<https://devfeed.tech/sources/shopify-engineering-shopify-engineering.md>)

Topics: [iOS](<https://devfeed.tech/topics/ios.md>), [Boilerplate](<https://devfeed.tech/topics/boilerplate.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [how-to](<https://devfeed.tech/tags/how-to.md>), [ios](<https://devfeed.tech/tags/ios.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [swift](<https://devfeed.tech/tags/swift.md>)

## AI overview

A tutorial on recreating Kotlin data-class-style copying for Swift structs while preserving immutable state patterns.

## Source excerpt

Swift's struct isn't as convenient as Kotlin's data class because it doesn't have a similar copy function. Learn how to adopt this pattern in Swift.