Skip to content

Commit cb899a8

Browse files
authored
Add missing documentation (#67)
* Add some more docs * Update min version of SPM in README SPM caused crashes when skipping from 1.0.0 - 1.1.1. Just start from the latest and there shouldn't be an issue.
1 parent 1db0674 commit cb899a8

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ import PackageDescription
4444
let package = Package(
4545
name: "YOUR_PROJECT_NAME",
4646
dependencies: [
47-
.package(url: "https://github.com/parse-community/Parse-Swift.git", from: "1.0.0"),
47+
.package(url: "https://github.com/parse-community/Parse-Swift", from: "1.1.1"),
4848
]
4949
)
5050
```

Sources/ParseSwift/Coding/Extensions.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,21 @@ extension JSONEncoder {
3131

3232
// MARK: ParseObject
3333
public extension ParseObject {
34+
/// The Parse encoder is used to JSON encode all `ParseObject`s and
35+
/// types in a way meaninful for a Parse Server to consume.
3436
func getEncoder() -> ParseEncoder {
3537
return ParseCoding.parseEncoder()
3638
}
3739

40+
/// The JSON encoder setup with the correct `dateEncodingStrategy`
41+
/// strategy to send data to a Parse Server.
3842
func getJSONEncoder() -> JSONEncoder {
3943
return ParseCoding.jsonEncoder()
4044
}
4145

46+
/// The JSON decoder setup with the correct `dateDecodingStrategy`
47+
/// strategy to decode data from a Parse Server. This encoder is used to decode all data received
48+
/// from the server.
4249
func getDecoder() -> JSONDecoder {
4350
ParseCoding.jsonDecoder()
4451
}

Sources/ParseSwift/Coding/ParseCoding.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,25 @@ public enum ParseCoding {}
1414
// MARK: Coders
1515
extension ParseCoding {
1616

17-
///This should only be used for Unit tests, don't use in SDK
17+
/// The JSON Encoder setup with the correct `dateEncodingStrategy`
18+
/// strategy for `Parse`.
1819
static func jsonEncoder() -> JSONEncoder {
1920
let encoder = JSONEncoder()
2021
encoder.dateEncodingStrategy = jsonDateEncodingStrategy
2122
return encoder
2223
}
2324

25+
/// The JSON Decoder setup with the correct `dateDecodingStrategy`
26+
/// strategy for `Parse`. This encoder is used to decode all data received
27+
/// from the server.
2428
static func jsonDecoder() -> JSONDecoder {
2529
let decoder = JSONDecoder()
2630
decoder.dateDecodingStrategy = dateDecodingStrategy
2731
return decoder
2832
}
2933

34+
/// The Parse Encoder is used to JSON encode all `ParseObject`s and
35+
/// types in a way meaninful for the Parse Server to consume.
3036
static func parseEncoder() -> ParseEncoder {
3137
ParseEncoder(
3238
dateEncodingStrategy: parseDateEncodingStrategy

0 commit comments

Comments
 (0)