-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathGameScore.swift
More file actions
executable file
·35 lines (31 loc) · 803 Bytes
/
GameScore.swift
File metadata and controls
executable file
·35 lines (31 loc) · 803 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//
// GameScore.swift
//
//
// Created by Corey E. Baker on 6/21/22.
//
import Foundation
import ParseSwift
/**
An example `ParseObject`. This is for testing. You can
remove when creating your application.
*/
struct GameScore: ParseObject {
// These are required by ParseObject.
var objectId: String?
var createdAt: Date?
var updatedAt: Date?
var ACL: ParseACL?
var originalData: Data?
// Your own properties.
var points: Int?
// Implement your own version of merge.
func merge(with object: Self) throws -> Self {
var updated = try mergeParse(with: object)
if updated.shouldRestoreKey(\.points,
original: object) {
updated.points = object.points
}
return updated
}
}