Skip to content

Commit 92bd001

Browse files
authored
Merge branch 'main' into add-migration-guide
2 parents 5306622 + 48bec30 commit 92bd001

File tree

113 files changed

+5018
-1039
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+5018
-1039
lines changed

.codecov.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ coverage:
66
status:
77
patch:
88
default:
9-
target: 33
9+
target: auto
1010
changes: false
1111
project:
1212
default:

.swiftlint.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ disabled_rules:
55
- type_body_length
66
- inclusive_language
77
- comment_spacing
8+
- identifier_name
89
excluded: # paths to ignore during linting. Takes precedence over `included`.
910
- Tests/ParseSwiftTests/ParseEncoderTests
1011
- DerivedData

CHANGELOG.md

Lines changed: 45 additions & 15 deletions
Large diffs are not rendered by default.

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Together we will plan out the best conceptual approach for your contribution, so
2727

2828
When you are ready to code, you can find more information about opening a pull request in the [GitHub docs](https://help.github.com/articles/creating-a-pull-request/).
2929

30-
Whether this is your first contribution or you are already an experienced contributor, the Parse Community has your back – don't hesitate to ask for help!
30+
Whether this is your first contribution or you are already an experienced contributor, the Parse Community has your back – do not hesitate to ask for help!
3131

3232
## Why Contributing?
3333

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ score.save { result in
121121
assert(savedScore.points == 10)
122122

123123
/*: To modify, need to make it a var as the value type
124-
was initialized as immutable. Using `mutable`
124+
was initialized as immutable. Using `mergeable`
125125
allows you to only send the updated keys to the
126126
parse server as opposed to the whole object.
127127
*/
@@ -195,7 +195,7 @@ var score2ForFetchedLater: GameScore?
195195
}
196196
}*/
197197

198-
//: Save synchronously (not preferred - all operations on main queue).
198+
//: Save synchronously (not preferred - all operations on current queue).
199199
let savedScore: GameScore?
200200
do {
201201
savedScore = try score.save()
@@ -211,7 +211,7 @@ assert(savedScore?.updatedAt != nil)
211211
assert(savedScore?.points == 10)
212212

213213
/*: To modify, need to make it a var as the value type
214-
was initialized as immutable. Using `mutable`
214+
was initialized as immutable. Using `mergeable`
215215
allows you to only send the updated keys to the
216216
parse server as opposed to the whole object.
217217
*/
@@ -274,7 +274,7 @@ do {
274274
//: Now we will fetch a ParseObject that has already been saved based on its' objectId.
275275
let scoreToFetch = GameScore(objectId: savedScore?.objectId)
276276

277-
//: Asynchronously (preferred way) fetch this GameScore based on it's objectId alone.
277+
//: Asynchronously (preferred way) fetch this GameScore based on it is objectId alone.
278278
scoreToFetch.fetch { result in
279279
switch result {
280280
case .success(let fetchedScore):
@@ -284,7 +284,7 @@ scoreToFetch.fetch { result in
284284
}
285285
}
286286

287-
//: Synchronously fetch this GameScore based on it's objectId alone.
287+
//: Synchronously fetch this GameScore based on it is objectId alone.
288288
do {
289289
let fetchedScore = try scoreToFetch.fetch()
290290
print("Successfully fetched: \(fetchedScore)")
@@ -295,7 +295,7 @@ do {
295295
//: Now we will fetch `ParseObject`'s in batch that have already been saved based on its' objectId.
296296
let score2ToFetch = GameScore(objectId: score2ForFetchedLater?.objectId)
297297

298-
//: Asynchronously (preferred way) fetch GameScores based on it's objectId alone.
298+
//: Asynchronously (preferred way) fetch GameScores based on it is objectId alone.
299299
[scoreToFetch, score2ToFetch].fetchAll { result in
300300
switch result {
301301
case .success(let fetchedScores):
@@ -315,7 +315,7 @@ let score2ToFetch = GameScore(objectId: score2ForFetchedLater?.objectId)
315315

316316
var fetchedScore: GameScore!
317317

318-
//: Synchronously fetchAll GameScore's based on it's objectId's alone.
318+
//: Synchronously fetchAll GameScore's based on it is objectId's alone.
319319
do {
320320
let fetchedScores = try [scoreToFetch, score2ToFetch].fetchAll()
321321
fetchedScores.forEach { result in
@@ -331,7 +331,7 @@ do {
331331
assertionFailure("Error fetching: \(error)")
332332
}
333333

334-
//: Asynchronously (preferred way) deleteAll GameScores based on it's objectId alone.
334+
//: Asynchronously (preferred way) deleteAll GameScores based on it is objectId alone.
335335
[scoreToFetch, score2ToFetch].deleteAll { result in
336336
switch result {
337337
case .success(let deletedScores):
@@ -348,7 +348,7 @@ do {
348348
}
349349
}
350350

351-
//: Synchronously deleteAll GameScore's based on it's objectId's alone.
351+
//: Synchronously deleteAll GameScore's based on it is objectId's alone.
352352
//: Commented out because the async above deletes the items already.
353353
/* do {
354354
let fetchedScores = try [scoreToFetch, score2ToFetch].deleteAll()

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,10 @@ var savedRole: Role<User>?
109109

110110
//: Now we will create the Role.
111111
guard let currentUser = User.current else {
112-
fatalError("User currently isn't signed in")
112+
fatalError("User currently is not signed in")
113113
}
114114

115-
//: Every Role requires an ACL that can't be changed after saving.
115+
//: Every Role requires an ACL that cannot be changed after saving.
116116
var acl = ParseACL()
117117
acl.setReadAccess(user: currentUser, value: true)
118118
acl.setWriteAccess(user: currentUser, value: true)
@@ -312,7 +312,7 @@ let score2 = GameScore(points: 57)
312312
print(error)
313313
}
314314
case .failure(let error):
315-
print("Couldn't save scores. \(error)")
315+
print("Could not save scores. \(error)")
316316
}
317317
}
318318

ParseSwift.playground/Pages/14 - Config.xcplaygroundpage/Contents.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ config.save { result in
5555
}
5656
}
5757

58-
//: Fetch the updated config to make sure it's saved.
58+
//: Fetch the updated config to make sure it is saved.
5959
config.fetch { result in
6060
switch result {
6161
case .success(let currentConfig):
@@ -65,7 +65,7 @@ config.fetch { result in
6565
}
6666
}
6767

68-
//: Anytime you fetch or update your Config successfully, it's automatically saved to your Keychain.
68+
//: Anytime you fetch or update your Config successfully, it is automatically saved to your Keychain.
6969
print(Config.current ?? "No config")
7070

7171
PlaygroundPage.current.finishExecution()

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ score.save { result in
7575
assert(savedScore.updatedAt != nil)
7676
assert(savedScore.points == 10)
7777

78-
//: Now that this object has a `createdAt`, it's properly saved to the server.
78+
//: Now that this object has a `createdAt`, it is properly saved to the server.
7979
//: Any changes to `createdAt` and `objectId` will not be saved to the server.
8080
print("Saved score: \(savedScore)")
8181

@@ -123,10 +123,10 @@ query.first { result in
123123
}
124124
}
125125

126-
//: Now we will attempt to fetch a ParseObject that isn't saved.
126+
//: Now we will attempt to fetch a ParseObject that is not saved.
127127
let scoreToFetch = GameScore(objectId: "hello")
128128

129-
//: Asynchronously (preferred way) fetch this GameScore based on it's objectId alone.
129+
//: Asynchronously (preferred way) fetch this GameScore based on it is objectId alone.
130130
scoreToFetch.fetch { result in
131131
switch result {
132132
case .success(let fetchedScore):

ParseSwift.playground/Pages/17 - SwiftUI - Finding Objects.xcplaygroundpage/Contents.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//: For this page, make sure your build target is set to ParseSwift (iOS) and targeting
55
//: an iPhone, iPod, or iPad. Also be sure your `Playground Settings`
66
//: in the `File Inspector` is `Platform = iOS`. This is because
7-
//: SwiftUI in macOS Playgrounds doesn't seem to build correctly
7+
//: SwiftUI in macOS Playgrounds does not seem to build correctly
88
//: Be sure to switch your target and `Playground Settings` back to
99
//: macOS after leaving this page.
1010

ParseSwift.playground/Pages/18 - SwiftUI - Finding Objects With Custom ViewModel.xcplaygroundpage/Contents.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//: For this page, make sure your build target is set to ParseSwift (iOS) and targeting
55
//: an iPhone, iPod, or iPad. Also be sure your `Playground Settings`
66
//: in the `File Inspector` is `Platform = iOS`. This is because
7-
//: SwiftUI in macOS Playgrounds doesn't seem to build correctly
7+
//: SwiftUI in macOS Playgrounds does not seem to build correctly
88
//: Be sure to switch your target and `Playground Settings` back to
99
//: macOS after leaving this page.
1010

ParseSwift.playground/Pages/19 - SwiftUI - LiveQuery.xcplaygroundpage/Contents.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//: For this page, make sure your build target is set to ParseSwift (iOS) and targeting
55
//: an iPhone, iPod, or iPad. Also be sure your `Playground Settings`
66
//: in the `File Inspector` is `Platform = iOS`. This is because
7-
//: SwiftUI in macOS Playgrounds doesn't seem to build correctly
7+
//: SwiftUI in macOS Playgrounds does not seem to build correctly
88
//: Be sure to switch your target and `Playground Settings` back to
99
//: macOS after leaving this page.
1010

ParseSwift.playground/Pages/2 - Finding Objects.xcplaygroundpage/Contents.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ query.limit(2)
8989
}
9090
}
9191

92-
//: Query synchronously (not preferred - all operations on main queue).
92+
//: Query synchronously (not preferred - all operations on current queue).
9393
let results = try query.find()
9494
assert(results.count >= 1)
9595
results.forEach { score in

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ do {
127127
type: .array,
128128
options: ParseFieldOptions<[User]>(required: false, defauleValue: nil))
129129
} catch {
130-
print("Can't add field: \(gameScoreSchema)")
130+
print("Cannot add field: \(gameScoreSchema)")
131131
}
132132

133133
//: Now lets create the schema on the server.
@@ -136,7 +136,7 @@ gameScoreSchema.create { result in
136136
case .success(let savedSchema):
137137
print("Check GameScore2 in Dashboard. \nThe created schema: \(savedSchema)")
138138
case .failure(let error):
139-
print("Couldn't save schema: \(error)")
139+
print("Could not save schema: \(error)")
140140
}
141141
}
142142

@@ -157,7 +157,7 @@ gameScoreSchema.update { result in
157157
*/
158158
gameScoreSchema = updatedSchema
159159
case .failure(let error):
160-
print("Couldn't update schema: \(error)")
160+
print("Could not update schema: \(error)")
161161
}
162162
}
163163

@@ -174,7 +174,7 @@ gameScoreSchema.update { result in
174174
*/
175175
gameScoreSchema = updatedSchema
176176
case .failure(let error):
177-
print("Couldn't update schema: \(error)")
177+
print("Could not update schema: \(error)")
178178
}
179179
}
180180

@@ -184,13 +184,13 @@ gameScoreSchema.fetch { result in
184184
case .success(let fetchedGameScore):
185185
print("The fetched GameScore2 schema is: \(fetchedGameScore)")
186186
case .failure(let error):
187-
print("Couldn't fetch schema: \(error)")
187+
print("Could not fetch schema: \(error)")
188188
}
189189
}
190190

191191
/*:
192192
Fields can also be deleted on a schema. Lets remove
193-
the **data** field since it's not going being used.
193+
the **data** field since it is not going being used.
194194
*/
195195
gameScoreSchema = gameScoreSchema.deleteField("data")
196196

@@ -204,7 +204,7 @@ gameScoreSchema.update { result in
204204
*/
205205
gameScoreSchema = updatedSchema
206206
case .failure(let error):
207-
print("Couldn't update schema: \(error)")
207+
print("Could not update schema: \(error)")
208208
}
209209
}
210210

@@ -228,7 +228,7 @@ gameScoreSchema.update { result in
228228
*/
229229
gameScoreSchema = updatedSchema
230230
case .failure(let error):
231-
print("Couldn't update schema: \(error)")
231+
print("Could not update schema: \(error)")
232232
}
233233
}
234234

@@ -242,7 +242,7 @@ gameScore.save { result in
242242
case .success(let savedGameScore):
243243
print("The saved GameScore is: \(savedGameScore)")
244244
case .failure(let error):
245-
print("Couldn't save schema: \(error)")
245+
print("Could not save schema: \(error)")
246246
}
247247
}
248248

@@ -252,20 +252,20 @@ gameScoreSchema.purge { result in
252252
case .success:
253253
print("All objects have been purged from this schema.")
254254
case .failure(let error):
255-
print("Couldn't purge schema: \(error)")
255+
print("Could not purge schema: \(error)")
256256
}
257257
}
258258

259259
/*:
260-
As long as there's no data in your `ParseSchema` you can
260+
As long as there is no data in your `ParseSchema` you can
261261
delete the schema.
262262
*/
263263
gameScoreSchema.delete { result in
264264
switch result {
265265
case .success:
266266
print("The schema has been deleted.")
267267
case .failure(let error):
268-
print("Couldn't delete the schema: \(error)")
268+
print("Could not delete the schema: \(error)")
269269
}
270270
}
271271

ParseSwift.playground/Pages/21 - Cloud Push Notifications.xcplaygroundpage/Contents.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,17 +76,17 @@ push.send { result in
7676
//: Update the stored property with the lastest status id.
7777
pushStatusId = statusId
7878
case .failure(let error):
79-
print("Couldn't create push: \(error)")
79+
print("Could not create push: \(error)")
8080
}
8181
}
8282

83-
//: You can fetch the status of notificaiton if you know it's id.
83+
//: You can fetch the status of notificaiton if you know it is id.
8484
push.fetchStatus(pushStatusId) { result in
8585
switch result {
8686
case .success(let pushStatus):
8787
print("The push status is: \"\(pushStatus)\"")
8888
case .failure(let error):
89-
print("Couldn't fetch push status: \(error)")
89+
print("Could not fetch push status: \(error)")
9090
}
9191
}
9292

@@ -110,7 +110,7 @@ push2.send { result in
110110
//: Update the stored property with the lastest status id.
111111
pushStatusId = statusId
112112
case .failure(let error):
113-
print("Couldn't create push: \(error)")
113+
print("Could not create push: \(error)")
114114
}
115115
}
116116

@@ -123,7 +123,7 @@ push2.fetchStatus(pushStatusId) { result in
123123
case .success(let pushStatus):
124124
print("The push status is: \"\(pushStatus)\"")
125125
case .failure(let error):
126-
print("Couldn't fetch push status: \(error)")
126+
print("Could not fetch push status: \(error)")
127127
}
128128
}
129129

@@ -143,7 +143,7 @@ push3.send { result in
143143
//: Update the stored property with the lastest status id.
144144
pushStatusId = statusId
145145
case .failure(let error):
146-
print("Couldn't create push: \(error)")
146+
print("Could not create push: \(error)")
147147
}
148148
}
149149

@@ -156,7 +156,7 @@ push3.fetchStatus(pushStatusId) { result in
156156
case .success(let pushStatus):
157157
print("The Firebase push status is: \"\(pushStatus)\"")
158158
case .failure(let error):
159-
print("Couldn't fetch push status: \(error)")
159+
print("Could not fetch push status: \(error)")
160160
}
161161
}
162162

@@ -177,7 +177,7 @@ query.findAll(options: [.useMasterKey]) { result in
177177
case .success(let pushStatus):
178178
print("All matching statuses: \"\(pushStatus)\"")
179179
case .failure(let error):
180-
print("Couldn't perform query: \(error)")
180+
print("Could not perform query: \(error)")
181181
}
182182
}
183183

ParseSwift.playground/Pages/4 - User - Continued.xcplaygroundpage/Contents.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ currentUser?.save { result in
149149

150150
switch result {
151151
case .success(let updatedUser):
152-
print("Successfully save custom fields of User to ParseServer: \(updatedUser)")
152+
print("Successfully saved custom fields of User to ParseServer: \(updatedUser)")
153153
case .failure(let error):
154154
print("Failed to update user: \(error)")
155155
}

ParseSwift.playground/Pages/6 - Installation.xcplaygroundpage/Contents.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ installationToUpdate?.save { results in
7777

7878
switch results {
7979
case .success(let updatedInstallation):
80-
print("Successfully save myCustomInstallationKey to ParseServer: \(updatedInstallation)")
80+
print("Successfully saved myCustomInstallationKey to ParseServer: \(updatedInstallation)")
8181
case .failure(let error):
8282
print("Failed to update installation: \(error)")
8383
}

0 commit comments

Comments
 (0)