Skip to content

Commit 2d154a8

Browse files
authored
Revise README sections on UserDefaults and Any
Updated README to remove UserDefaults section and add Any section.
1 parent e34242f commit 2d154a8

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ A Swift library for serializing `Codable` types to and from `Any` and `UserDefau
88

99
## Usage
1010

11-
### UserDefaults
12-
1311
Encode and decode [`Codable`](https://developer.apple.com/documentation/swift/codable) types with [`UserDefaults`](https://developer.apple.com/documentation/foundation/userdefaults):
1412

1513
```swift
@@ -51,7 +49,9 @@ let url = try UserDefaults.standard.decode(URL.self, forKey: "url")
5149
let duration = try UserDefaults.standard.decode(Duration.self, forKey: "duration")
5250
```
5351

54-
### KeyValueEncoder
52+
### Any
53+
54+
All values are encoded and decoded via `Any`.
5555

5656
[`RawRepresentable`](https://developer.apple.com/documentation/swift/rawrepresentable) types are encoded to their raw value:
5757

@@ -79,8 +79,6 @@ struct User: Codable {
7979
let any = try KeyValueEncoder().encode(User(id: 1, name: "Herbert"))
8080
```
8181

82-
### KeyValueDecoder
83-
8482
Decode values from `Any`:
8583

8684
```swift

0 commit comments

Comments
 (0)