Copyable

0.0.3

A Swift Macro for Kotlin like copy() for Structs.
eu-digital-identity-wallet/SwiftCopyableMacro

What's New

0.0.3

2025-03-28T02:58:44Z

What's Changed

Full Changelog: 0.0.1...0.0.3

SwiftCopyableMacro

A Swift Macro for Kotlin like copy() for Structs.

How to use

Installation

.package(
  url: "https://github.com/eu-digital-identity-wallet/SwiftCopyableMacro.git",
  from: "0.0.1"
)
targets: [
  .target(
    name: "ExampleProject",
    dependencies: [
      .product(
        name: "Copyable",
        package: "SwiftCopyableMacro"
      )
    ]
  )
]

Usage

@Copyable
struct Dog {
  let name: String
  let age: Int
}
let dog = Dog(name: "Fido", age: 5)
let simpleCopy = dog.copy(name: "Pablo")
let chainedCopy = dog.copy(name: "Nobet").copy(age: 11)
let combinedCopy = dog.copy(name: "Rex", age: 2)

Description

  • Swift Tools 6.0.0
View More Packages from this Author

Dependencies

Last updated: Tue Jun 03 2025 03:48:21 GMT-0900 (Hawaii-Aleutian Daylight Time)