File tree Expand file tree Collapse file tree 3 files changed +15
-2
lines changed
Sources/ParseSwift/Coding Expand file tree Collapse file tree 3 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ import PackageDescription
44
44
let package = Package (
45
45
name : " YOUR_PROJECT_NAME" ,
46
46
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 " ),
48
48
]
49
49
)
50
50
```
Original file line number Diff line number Diff line change @@ -31,14 +31,21 @@ extension JSONEncoder {
31
31
32
32
// MARK: ParseObject
33
33
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.
34
36
func getEncoder( ) -> ParseEncoder {
35
37
return ParseCoding . parseEncoder ( )
36
38
}
37
39
40
+ /// The JSON encoder setup with the correct `dateEncodingStrategy`
41
+ /// strategy to send data to a Parse Server.
38
42
func getJSONEncoder( ) -> JSONEncoder {
39
43
return ParseCoding . jsonEncoder ( )
40
44
}
41
45
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.
42
49
func getDecoder( ) -> JSONDecoder {
43
50
ParseCoding . jsonDecoder ( )
44
51
}
Original file line number Diff line number Diff line change @@ -14,19 +14,25 @@ public enum ParseCoding {}
14
14
// MARK: Coders
15
15
extension ParseCoding {
16
16
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`.
18
19
static func jsonEncoder( ) -> JSONEncoder {
19
20
let encoder = JSONEncoder ( )
20
21
encoder. dateEncodingStrategy = jsonDateEncodingStrategy
21
22
return encoder
22
23
}
23
24
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.
24
28
static func jsonDecoder( ) -> JSONDecoder {
25
29
let decoder = JSONDecoder ( )
26
30
decoder. dateDecodingStrategy = dateDecodingStrategy
27
31
return decoder
28
32
}
29
33
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.
30
36
static func parseEncoder( ) -> ParseEncoder {
31
37
ParseEncoder (
32
38
dateEncodingStrategy: parseDateEncodingStrategy
You can’t perform that action at this time.
0 commit comments