Skip to content

Commit 4141c18

Browse files
committed
meta: readme
1 parent e7ae8e0 commit 4141c18

2 files changed

Lines changed: 19 additions & 3 deletions

File tree

‎README.md‎

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,29 @@ extension TestManualCodable: Codable {
104104

105105
**With `ExCodable`**:
106106

107+
`[new]` 1.x version:
108+
107109
```swift
108110
struct TestExCodable: Equatable {
111+
@ExCodable
112+
private(set) var int: Int = 0
113+
@ExCodable("string", "str")
114+
private(set) var string: String? = nil
115+
}
116+
117+
extension TestExCodable: ExAutoCodable {}
118+
119+
```
120+
121+
0.x version:
122+
123+
```swift
124+
struct TestExCodableProtocol: Equatable {
109125
private(set) var int: Int = 0
110126
private(set) var string: String?
111127
}
112128

113-
extension TestExCodable: ExCodable {
129+
extension TestExCodableProtocol: ExCodableProtocol {
114130
static let keyMapping: [KeyMap<Self>] = [
115131
KeyMap(\.int, to: "int"),
116132
KeyMap(\.string, to: "string")

Sources/ExCodable/ExCodable+DEPRECATED.swift renamed to Sources/ExCodable/ExCodableProtocol+DEPRECATED.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
2-
// ExCodable.swift
3-
// ExCodable
2+
// ExCodableProtocol+DEPRECATED.swift
3+
// ExCodableProtocol
44
//
55
// Created by Míng on 2021-07-01.
66
// Copyright (c) 2023 Míng <i+ExCodable@iwill.im>. Released under the MIT license.

0 commit comments

Comments
 (0)