Skip to content

Commit 4c09b36

Browse files
committed
add OptionalKeyed, Default generate init
1 parent cd9c835 commit 4c09b36

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ let doubleTransform = SCTransformOf<Int, Double> {
7878

7979
- Try to merge `@KeyedTransform` into `@Keyed`, but it required `@Keyed var id: String` to be `@Keyed() var id: String`, with extra `()` 🧐
8080

81+
- Swift should auto generate `STRUCT.init(....)` for you, **but** if you using `@Keyed var id: String` without default value, it will generate `init(id: Keyed<String>)`, by giving default value `@Keyed var id: String = ""` should solve this problem.
82+
8183
## Know Issues
8284

83-
- `@Keyed var id:String?` will cause fatalError on force unwrapping `Keyed.value?`
85+
- `@Keyed var id:String?` will cause fatalError on force unwrapping `Keyed.value?`, you can using `@OptionalKeyed` to make it works.
86+
- `OptionalKeyed` may / may not a good name, I am thinking of make the easy to change, maybe `KeyedOptional` is EASY change? 🤔

0 commit comments

Comments
 (0)