Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryu0118 authored Jun 8, 2023
1 parent 296ce49 commit 3b28ccc
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,22 @@ let parents = Parents(

parents.recursivelyAllKeyPaths // [\.mother, \.mother.name, \.mother.age, \.father, \.father.name, \.father.age]
```

## Known Issue
Computed properties added by extension are not included in `allKeyPaths` due to macro specifications.
You need to add them manually in this way.
```Swift
@KeyPathIterable
struct Hoge {
let hoge: String
}

extension Hoge {
var fuga: Int { 0 }
static var additionalKeyPaths: [PartialKeyPath<Self>] {
[\.fuga]
}
}

Hoge.allKeyPaths // [\.hoge, \.fuga]
```

0 comments on commit 3b28ccc

Please sign in to comment.