Skip to content

Commit 7c6c305

Browse files
authored
docs: improve documentation sections (#276)
* docs: improve ParseUser documentation * more docs * fixes * conform to protocol * More doc updates * bump version * Remove codecov filter * nits
1 parent 37a2247 commit 7c6c305

38 files changed

+133
-81
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ jobs:
2525
uses: sersoft-gmbh/swift-coverage-action@v2
2626
id: coverage-files
2727
with:
28-
target-name-filter: '^ParseSwift$'
2928
format: lcov
3029
search-paths: ./DerivedData
3130
env:

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,15 @@
22

33
### main
44

5-
[Full Changelog](https://github.com/parse-community/Parse-Swift/compare/2.2.2...main)
5+
[Full Changelog](https://github.com/parse-community/Parse-Swift/compare/2.2.3...main)
66
* _Contributing to this repo? Add info about your change here to be included in the next release_
77

8+
### 2.2.3
9+
[Full Changelog](https://github.com/parse-community/Parse-Swift/compare/2.2.2...2.2.3)
10+
11+
__Fixes__
12+
- Improve dpcumentation ([#276](https://github.com/parse-community/Parse-Swift/pull/276)), thanks to [Corey Baker](https://github.com/cbaker6).
13+
814
### 2.2.2
915
[Full Changelog](https://github.com/parse-community/Parse-Swift/compare/2.2.1...2.2.2)
1016

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

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ struct GameScore: ParseObject {
2121
var ACL: ParseACL?
2222

2323
//: Your own properties.
24-
var score: Int = 0
24+
var score: Int? = 0
2525
}
2626

2727
//: It's recommended to place custom initializers in an extension
@@ -45,7 +45,7 @@ do {
4545
savedScore = try GameScore(score: 102).save()
4646
} catch {
4747
savedScore = nil
48-
fatalError("Error saving: \(error)")
48+
assertionFailure("Error saving: \(error)")
4949
}
5050

5151
//: Then we will increment the score.
@@ -69,8 +69,20 @@ do {
6969
print(error)
7070
}
7171

72-
//: There are other operations: add/remove/delete objects from `ParseObject`s.
72+
//: You can also remove a value for a property using unset.
73+
let unsetOperation = savedScore
74+
.operation.unset(("score", \.score))
75+
do {
76+
let updatedScore = try unsetOperation.save()
77+
print("Updated score: \(updatedScore). Check the new score on Parse Dashboard.")
78+
} catch {
79+
print(error)
80+
}
81+
82+
//: There are other operations: set/forceSet/unset/add/remove, etc. objects from `ParseObject`s.
7383
//: In fact, the `users` and `roles` relations from `ParseRoles` used the add/remove operations.
84+
//: Multiple operations can be chained together. See:
85+
//: https://github.com/parse-community/Parse-Swift/pull/268#issuecomment-955714414
7486
let operations = savedScore.operation
7587

7688
//: Example: operations.add("hello", objects: ["test"]).

Sources/ParseSwift/Authentication/3rd Party/ParseApple/ParseApple+async.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import Foundation
1111

1212
@available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
1313
public extension ParseApple {
14-
// MARK: Login - Async/Await
14+
// MARK: Async/Await
1515

1616
/**
1717
Login a `ParseUser` *asynchronously* using Apple authentication.
@@ -51,7 +51,6 @@ public extension ParseApple {
5151

5252
@available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
5353
public extension ParseApple {
54-
// MARK: Link - Async/Await
5554

5655
/**
5756
Link the *current* `ParseUser` *asynchronously* using Apple authentication.

Sources/ParseSwift/Authentication/3rd Party/ParseApple/ParseApple+combine.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import Foundation
1111
import Combine
1212

1313
public extension ParseApple {
14-
// MARK: Login - Combine
14+
// MARK: Combine
1515

1616
/**
1717
Login a `ParseUser` *asynchronously* using Apple authentication. Publishes when complete.
@@ -48,7 +48,6 @@ public extension ParseApple {
4848
}
4949

5050
public extension ParseApple {
51-
// MARK: Link - Combine
5251

5352
/**
5453
Link the *current* `ParseUser` *asynchronously* using Apple authentication. Publishes when complete.

Sources/ParseSwift/Authentication/3rd Party/ParseFacebook/ParseFacebook+async.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import Foundation
1111

1212
@available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
1313
public extension ParseFacebook {
14-
// MARK: Login - Async/Await
14+
// MARK: Async/Await
1515

1616
/**
1717
Login a `ParseUser` *asynchronously* using Facebook authentication for limited login.
@@ -75,7 +75,6 @@ public extension ParseFacebook {
7575

7676
@available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
7777
public extension ParseFacebook {
78-
// MARK: Link - Async/Await
7978
/**
8079
Link the *current* `ParseUser` *asynchronously* using Facebook authentication for limited login.
8180
- parameter userId: The `userId` from `FacebookSDK`.

Sources/ParseSwift/Authentication/3rd Party/ParseFacebook/ParseFacebook+combine.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import Foundation
1111
import Combine
1212

1313
public extension ParseFacebook {
14-
// MARK: Login - Combine
14+
// MARK: Combine
1515
/**
1616
Login a `ParseUser` *asynchronously* using Facebook authentication for limited login. Publishes when complete.
1717
- parameter userId: The `userId` from `FacebookSDK`.
@@ -70,7 +70,6 @@ public extension ParseFacebook {
7070
}
7171

7272
public extension ParseFacebook {
73-
// MARK: Link - Combine
7473
/**
7574
Link the *current* `ParseUser` *asynchronously* using Facebook authentication for limited login.
7675
Publishes when complete.

Sources/ParseSwift/Authentication/3rd Party/ParseLDAP/ParseLDAP+async.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import Foundation
1111

1212
@available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
1313
public extension ParseLDAP {
14-
// MARK: Login - Async/Await
14+
// MARK: Async/Await
1515
/**
1616
Login a `ParseUser` *asynchronously* using LDAP authentication.
1717
- parameter id: The id of the `user`.
@@ -50,7 +50,6 @@ public extension ParseLDAP {
5050

5151
@available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
5252
public extension ParseLDAP {
53-
// MARK: Link - Async/Await
5453
/**
5554
Link the *current* `ParseUser` *asynchronously* using LDAP authentication.
5655
- parameter id: The id of the `user`.

Sources/ParseSwift/Authentication/3rd Party/ParseLDAP/ParseLDAP+combine.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import Foundation
1111
import Combine
1212

1313
public extension ParseLDAP {
14-
// MARK: Login - Combine
14+
// MARK: Combine
1515
/**
1616
Login a `ParseUser` *asynchronously* using LDAP authentication. Publishes when complete.
1717
- parameter id: The id of the `user`.
@@ -47,7 +47,6 @@ public extension ParseLDAP {
4747
}
4848

4949
public extension ParseLDAP {
50-
// MARK: Link - Combine
5150
/**
5251
Link the *current* `ParseUser` *asynchronously* using LDAP authentication. Publishes when complete.
5352
- parameter id: The id of the `user`.

Sources/ParseSwift/Authentication/3rd Party/ParseTwitter/ParseTwitter+async.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import Foundation
1111

1212
@available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
1313
public extension ParseTwitter {
14-
// MARK: Login - Async/Await
14+
// MARK: Async/Await
1515

1616
/**
1717
Login a `ParseUser` *asynchronously* using Twitter authentication.
@@ -63,7 +63,6 @@ public extension ParseTwitter {
6363

6464
@available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
6565
public extension ParseTwitter {
66-
// MARK: Link - Async/Await
6766

6867
/**
6968
Link the *current* `ParseUser` *asynchronously* using Twitter authentication.

0 commit comments

Comments
 (0)