Skip to content

Commit b96f4d7

Browse files
authored
feat: add isDirtyForKey method for ParseObjects (#9)
* feat: add isDirtyForKey method for ParseObjects * doc nits * update ci macOS images
1 parent 56d556f commit b96f4d7

File tree

22 files changed

+97
-116
lines changed

22 files changed

+97
-116
lines changed

.github/workflows/ci.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,19 @@ on:
44
branches: [ main ]
55
pull_request:
66
branches: '*'
7+
78
env:
89
CI_XCODE_OLDEST: '/Applications/Xcode_12.5.1.app/Contents/Developer'
910
CI_XCODE_13: '/Applications/Xcode_13.4.1.app/Contents/Developer'
1011
CI_XCODE_LATEST: '/Applications/Xcode_14.0.1.app/Contents/Developer'
1112

13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
1217
jobs:
1318
xcode-test-ios:
14-
runs-on: macos-12
19+
runs-on: macos-latest
1520
steps:
1621
- uses: actions/checkout@v3
1722
- name: Use multiple cores
@@ -38,7 +43,7 @@ jobs:
3843
DEVELOPER_DIR: ${{ env.CI_XCODE_LATEST }}
3944

4045
xcode-test-macos:
41-
runs-on: macos-12
46+
runs-on: macos-latest
4247
steps:
4348
- uses: actions/checkout@v3
4449
- name: Create and set the default keychain
@@ -71,7 +76,7 @@ jobs:
7176
DEVELOPER_DIR: ${{ env.CI_XCODE_LATEST }}
7277

7378
xcode-test-tvos:
74-
runs-on: macos-12
79+
runs-on: macos-latest
7580
steps:
7681
- uses: actions/checkout@v3
7782
- name: Use multiple cores
@@ -98,7 +103,7 @@ jobs:
98103
DEVELOPER_DIR: ${{ env.CI_XCODE_LATEST }}
99104

100105
xcode-build-watchos:
101-
runs-on: macos-12
106+
runs-on: macos-latest
102107
steps:
103108
- uses: actions/checkout@v3
104109
- name: Use multiple cores
@@ -115,7 +120,7 @@ jobs:
115120
DEVELOPER_DIR: ${{ env.CI_XCODE_LATEST }}
116121

117122
spm-test:
118-
runs-on: macos-12
123+
runs-on: macos-latest
119124
steps:
120125
- uses: actions/checkout@v3
121126
- name: Create and set the default keychain
@@ -149,7 +154,7 @@ jobs:
149154

150155
xcode-test-ios-5_3:
151156
needs: xcode-build-watchos
152-
runs-on: macos-latest
157+
runs-on: macos-11
153158
steps:
154159
- uses: actions/checkout@v3
155160
- name: Build-Test
@@ -226,7 +231,7 @@ jobs:
226231

227232
docs:
228233
needs: xcode-build-watchos
229-
runs-on: macos-12
234+
runs-on: macos-latest
230235
steps:
231236
- uses: actions/checkout@v3
232237
- name: Use multiple cores
@@ -238,7 +243,7 @@ jobs:
238243

239244
carthage:
240245
needs: xcode-build-watchos
241-
runs-on: macos-12
246+
runs-on: macos-latest
242247
steps:
243248
- uses: actions/checkout@v3
244249
- name: Use multiple cores

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ env:
88

99
jobs:
1010
docs:
11-
runs-on: macos-12
11+
runs-on: macos-latest
1212
steps:
1313
- uses: actions/checkout@v3
1414
- name: Get release version

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
[Full Changelog](https://github.com/netreconlab/Parse-Swift/compare/4.15.2...main), [Documentation](https://swiftpackageindex.com/netreconlab/Parse-Swift/main/documentation/parseswift)
55
* _Contributing to this repo? Add info about your change here to be included in the next release_
66

7+
__New features__
8+
- Added the ability to check if a `ParseObject` key is dirty ([#9](https://github.com/netreconlab/Parse-Swift/pull/9)), thanks to [Corey Baker](https://github.com/cbaker6).
9+
710
### 4.15.2
811
[Full Changelog](https://github.com/netreconlab/Parse-Swift/compare/4.15.1...4.15.2), [Documentation](https://swiftpackageindex.com/netreconlab/Parse-Swift/4.15.2/documentation/parseswift)
912

ParseSwift.playground/Pages/1 - Your first Object.xcplaygroundpage/Contents.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,10 @@ score.save { result in
128128

129129
/*:
130130
To modify, you need to make it a var as the value type
131-
was initialized as immutable. Using `mergeable`
131+
was initialized as immutable. Using `.mergeable`
132132
allows you to only send the updated keys to the
133133
parse server as opposed to the whole object. Make sure
134-
to call `mergeable` before you begin
134+
to call `.mergeable` before you begin
135135
your first mutation of your `ParseObject`.
136136
*/
137137
var changedScore = savedScore.mergeable
@@ -221,10 +221,10 @@ assert(savedScore?.points == 10)
221221

222222
/*:
223223
To modify, you need to make a mutable copy of `savedScore`.
224-
Instead of using `mergeable` this time, we will use the `set()`
224+
Instead of using `.mergeable` this time, we will use the `set()`
225225
method which allows us to accomplish the same thing
226-
as `mergeable`. You can choose to use `set()` or
227-
`mergeable` as long as you use either before you begin
226+
as `.mergeable`. You can choose to use `.set()` or
227+
`.mergeable` as long as you use either before you begin
228228
your first mutation of your `ParseObject`.
229229
*/
230230
guard var changedScore = savedScore else {

ParseSwift.playground/Pages/10 - Cloud Code.xcplaygroundpage/Contents.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,6 @@ extension GameScore {
165165
init(points: Int) {
166166
self.points = points
167167
}
168-
169-
init(objectId: String?) {
170-
self.objectId = objectId
171-
}
172168
}
173169

174170
//: Define a GameScore.

ParseSwift.playground/Pages/12 - Roles and Relations.xcplaygroundpage/Contents.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,6 @@ extension GameScore {
105105
init(points: Int) {
106106
self.points = points
107107
}
108-
109-
init(objectId: String?) {
110-
self.objectId = objectId
111-
}
112108
}
113109

114110
//: Roles can provide additional access/security to your apps.

ParseSwift.playground/Pages/13 - Operations.xcplaygroundpage/Contents.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,6 @@ extension GameScore {
5050
init(points: Int) {
5151
self.points = points
5252
}
53-
54-
init(objectId: String?) {
55-
self.objectId = objectId
56-
}
5753
}
5854

5955
//: You can have the server do operations on your `ParseObject`'s for you.

ParseSwift.playground/Pages/15 - Custom ObjectId.xcplaygroundpage/Contents.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,6 @@ extension GameScore {
5656
self.objectId = objectId
5757
self.points = points
5858
}
59-
60-
init(objectId: String) {
61-
self.objectId = objectId
62-
}
6359
}
6460

6561
//: Define initial GameScore this time with custom `objectId`.

ParseSwift.playground/Pages/20 - Cloud Schemas.xcplaygroundpage/Contents.swift

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -92,21 +92,6 @@ struct GameScore2: ParseObject {
9292
}
9393
}
9494

95-
/*:
96-
It's recommended to place custom initializers in an extension
97-
to preserve the memberwise initializer.
98-
*/
99-
extension GameScore2 {
100-
101-
init(points: Int) {
102-
self.points = points
103-
}
104-
105-
init(objectId: String?) {
106-
self.objectId = objectId
107-
}
108-
}
109-
11095
//: First lets create a new CLP for the new schema.
11196
let clp = ParseCLP(requiresAuthentication: true, publicAccess: false)
11297
.setAccessPublic(true, on: .get)

ParseSwift.playground/Pages/23 - Cloud Hook Triggers.xcplaygroundpage/Contents.swift

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,6 @@ struct GameScore: ParseObject {
3939
}
4040
}
4141

42-
//: It's recommended to place custom initializers in an extension
43-
//: to preserve the memberwise initializer.
44-
extension GameScore {
45-
46-
init(points: Int) {
47-
self.points = points
48-
}
49-
50-
init(objectId: String?) {
51-
self.objectId = objectId
52-
}
53-
}
54-
5542
/*:
5643
Parse Hook Triggers can be created by conforming to
5744
`ParseHookFunctionable`.

0 commit comments

Comments
 (0)