Skip to content

Latest commit

 

History

History
44 lines (32 loc) · 1.23 KB

File metadata and controls

44 lines (32 loc) · 1.23 KB

GitHub

KeyPathString

keyPathString macro allows you to generate a property name string value of a key path expression.

Installation

Xcode

  1. Click File > Add Package Dependencies
  2. Paste the following link into the search field on the upper-right:
    https://github.com/Jaesung-Jung/KeyPathStringMacro.git
    

Swift Package Manager

In Package.swift:

dependencies: [
    .package(url: "https://github.com/Jaesung-Jung/KeyPathStringMacro.git", from: "0.1.0")
]

And then add the dependency to your targets.

Usage

let keyPathString = #keyPathString(\User.name) // "name"

License

MIT license. See LICENSE for details.