Skip to content

Commit 12b8e75

Browse files
authored
refactor: Improve async methods to remove warnings (#198)
* refactor: Improve async methods to remove warnings * nit * Fix additional warning
1 parent c9d8c95 commit 12b8e75

35 files changed

+220
-258
lines changed

CHANGELOG.md

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

44
### main
5-
[Full Changelog](https://github.com/netreconlab/Parse-Swift/compare/5.12.2...main), [Documentation](https://swiftpackageindex.com/netreconlab/Parse-Swift/main/documentation/parseswift)
5+
[Full Changelog](https://github.com/netreconlab/Parse-Swift/compare/5.12.3...main), [Documentation](https://swiftpackageindex.com/netreconlab/Parse-Swift/main/documentation/parseswift)
66
* _Contributing to this repo? Add info about your change here to be included in the next release_
77

8+
### 5.12.3
9+
[Full Changelog](https://github.com/netreconlab/Parse-Swift/compare/5.12.2...5.12.3), [Documentation](https://swiftpackageindex.com/netreconlab/Parse-Swift/5.12.3/documentation/parseswift)
10+
11+
__Fixes__
12+
* Update async methods so they do not produce warnings in Swift 6.0 ([#198](https://github.com/netreconlab/Parse-Swift/pull/198)), thanks to [Corey Baker](https://github.com/cbaker6).
13+
814
### 5.12.2
915
[Full Changelog](https://github.com/netreconlab/Parse-Swift/compare/5.12.1...5.12.2), [Documentation](https://swiftpackageindex.com/netreconlab/Parse-Swift/5.12.2/documentation/parseswift)
1016

Sources/ParseSwift/API/API+Command+async.swift

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,13 @@ internal extension API.Command {
1919
childObjects: [String: PointerType]? = nil,
2020
childFiles: [String: ParseFile]? = nil) async -> Result<URLRequest, ParseError> {
2121
await withCheckedContinuation { continuation in
22-
self.prepareURLRequest(options: options,
23-
batching: batching,
24-
childObjects: childObjects,
25-
childFiles: childFiles,
26-
completion: continuation.resume)
22+
self.prepareURLRequest(
23+
options: options,
24+
batching: batching,
25+
childObjects: childObjects,
26+
childFiles: childFiles,
27+
completion: { continuation.resume(returning: $0) }
28+
)
2729
}
2830
}
2931

@@ -48,7 +50,7 @@ internal extension API.Command {
4850
allowIntermediateResponses: allowIntermediateResponses,
4951
uploadProgress: uploadProgress,
5052
downloadProgress: downloadProgress,
51-
completion: continuation.resume)
53+
completion: { continuation.resume(with: $0) })
5254
}
5355
}
5456
}

Sources/ParseSwift/API/API+NonParseBodyCommand+async.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ extension API.NonParseBodyCommand {
2121
await self.execute(options: options,
2222
callbackQueue: callbackQueue,
2323
allowIntermediateResponses: allowIntermediateResponses,
24-
completion: continuation.resume)
24+
completion: { continuation.resume(with: $0) })
2525
}
2626
}
2727
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public extension ParseApple {
2626
self.login(user: user,
2727
identityToken: identityToken,
2828
options: options,
29-
completion: continuation.resume)
29+
completion: { continuation.resume(with: $0) })
3030
}
3131
}
3232

@@ -42,7 +42,7 @@ public extension ParseApple {
4242
try await withCheckedThrowingContinuation { continuation in
4343
self.login(authData: authData,
4444
options: options,
45-
completion: continuation.resume)
45+
completion: { continuation.resume(with: $0) })
4646
}
4747
}
4848
}
@@ -64,7 +64,7 @@ public extension ParseApple {
6464
self.link(user: user,
6565
identityToken: identityToken,
6666
options: options,
67-
completion: continuation.resume)
67+
completion: { continuation.resume(with: $0) })
6868
}
6969
}
7070

@@ -80,7 +80,7 @@ public extension ParseApple {
8080
try await withCheckedThrowingContinuation { continuation in
8181
self.link(authData: authData,
8282
options: options,
83-
completion: continuation.resume)
83+
completion: { continuation.resume(with: $0) })
8484
}
8585
}
8686
}

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public extension ParseFacebook {
2929
authenticationToken: authenticationToken,
3030
expiresIn: expiresIn,
3131
options: options,
32-
completion: continuation.resume)
32+
completion: { continuation.resume(with: $0) })
3333
}
3434
}
3535

@@ -51,7 +51,7 @@ public extension ParseFacebook {
5151
accessToken: accessToken,
5252
expiresIn: expiresIn,
5353
options: options,
54-
completion: continuation.resume)
54+
completion: { continuation.resume(with: $0) })
5555
}
5656
}
5757

@@ -66,7 +66,7 @@ public extension ParseFacebook {
6666
try await withCheckedThrowingContinuation { continuation in
6767
self.login(authData: authData,
6868
options: options,
69-
completion: continuation.resume)
69+
completion: { continuation.resume(with: $0) })
7070
}
7171
}
7272
}
@@ -90,7 +90,7 @@ public extension ParseFacebook {
9090
authenticationToken: authenticationToken,
9191
expiresIn: expiresIn,
9292
options: options,
93-
completion: continuation.resume)
93+
completion: { continuation.resume(with: $0) })
9494
}
9595
}
9696

@@ -112,7 +112,7 @@ public extension ParseFacebook {
112112
accessToken: accessToken,
113113
expiresIn: expiresIn,
114114
options: options,
115-
completion: continuation.resume)
115+
completion: { continuation.resume(with: $0) })
116116
}
117117
}
118118

@@ -128,7 +128,7 @@ public extension ParseFacebook {
128128
try await withCheckedThrowingContinuation { continuation in
129129
self.link(authData: authData,
130130
options: options,
131-
completion: continuation.resume)
131+
completion: { continuation.resume(with: $0) })
132132
}
133133
}
134134
}

Sources/ParseSwift/Authentication/3rd Party/ParseGithub/ParseGitHub+async.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public extension ParseGitHub {
2626
self.login(id: id,
2727
accessToken: accessToken,
2828
options: options,
29-
completion: continuation.resume)
29+
completion: { continuation.resume(with: $0) })
3030
}
3131
}
3232

@@ -41,7 +41,7 @@ public extension ParseGitHub {
4141
try await withCheckedThrowingContinuation { continuation in
4242
self.login(authData: authData,
4343
options: options,
44-
completion: continuation.resume)
44+
completion: { continuation.resume(with: $0) })
4545
}
4646
}
4747
}
@@ -63,7 +63,7 @@ public extension ParseGitHub {
6363
self.link(id: id,
6464
accessToken: accessToken,
6565
options: options,
66-
completion: continuation.resume)
66+
completion: { continuation.resume(with: $0) })
6767
}
6868
}
6969

@@ -79,7 +79,7 @@ public extension ParseGitHub {
7979
try await withCheckedThrowingContinuation { continuation in
8080
self.link(authData: authData,
8181
options: options,
82-
completion: continuation.resume)
82+
completion: { continuation.resume(with: $0) })
8383
}
8484
}
8585
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public extension ParseGoogle {
2929
idToken: idToken,
3030
accessToken: accessToken,
3131
options: options,
32-
completion: continuation.resume)
32+
completion: { continuation.resume(with: $0) })
3333
}
3434
}
3535

@@ -44,7 +44,7 @@ public extension ParseGoogle {
4444
try await withCheckedThrowingContinuation { continuation in
4545
self.login(authData: authData,
4646
options: options,
47-
completion: continuation.resume)
47+
completion: { continuation.resume(with: $0) })
4848
}
4949
}
5050
}
@@ -69,7 +69,7 @@ public extension ParseGoogle {
6969
idToken: idToken,
7070
accessToken: accessToken,
7171
options: options,
72-
completion: continuation.resume)
72+
completion: { continuation.resume(with: $0) })
7373
}
7474
}
7575

@@ -85,7 +85,7 @@ public extension ParseGoogle {
8585
try await withCheckedThrowingContinuation { continuation in
8686
self.link(authData: authData,
8787
options: options,
88-
completion: continuation.resume)
88+
completion: { continuation.resume(with: $0) })
8989
}
9090
}
9191
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public extension ParseInstagram {
2929
accessToken: accessToken,
3030
apiURL: apiURL,
3131
options: options,
32-
completion: continuation.resume)
32+
completion: { continuation.resume(with: $0) })
3333
}
3434
}
3535

@@ -44,7 +44,7 @@ public extension ParseInstagram {
4444
try await withCheckedThrowingContinuation { continuation in
4545
self.login(authData: authData,
4646
options: options,
47-
completion: continuation.resume)
47+
completion: { continuation.resume(with: $0) })
4848
}
4949
}
5050
}
@@ -69,7 +69,7 @@ public extension ParseInstagram {
6969
accessToken: accessToken,
7070
apiURL: apiURL,
7171
options: options,
72-
completion: continuation.resume)
72+
completion: { continuation.resume(with: $0) })
7373
}
7474
}
7575

@@ -85,7 +85,7 @@ public extension ParseInstagram {
8585
try await withCheckedThrowingContinuation { continuation in
8686
self.link(authData: authData,
8787
options: options,
88-
completion: continuation.resume)
88+
completion: { continuation.resume(with: $0) })
8989
}
9090
}
9191
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public extension ParseLDAP {
2525
self.login(id: id,
2626
password: password,
2727
options: options,
28-
completion: continuation.resume)
28+
completion: { continuation.resume(with: $0) })
2929
}
3030
}
3131

@@ -41,7 +41,7 @@ public extension ParseLDAP {
4141
try await withCheckedThrowingContinuation { continuation in
4242
self.login(authData: authData,
4343
options: options,
44-
completion: continuation.resume)
44+
completion: { continuation.resume(with: $0) })
4545
}
4646
}
4747
}
@@ -62,7 +62,7 @@ public extension ParseLDAP {
6262
self.link(id: id,
6363
password: password,
6464
options: options,
65-
completion: continuation.resume)
65+
completion: { continuation.resume(with: $0) })
6666
}
6767
}
6868

@@ -78,7 +78,7 @@ public extension ParseLDAP {
7878
try await withCheckedThrowingContinuation { continuation in
7979
self.link(authData: authData,
8080
options: options,
81-
completion: continuation.resume)
81+
completion: { continuation.resume(with: $0) })
8282
}
8383
}
8484
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public extension ParseLinkedIn {
2828
accessToken: accessToken,
2929
isMobileSDK: isMobileSDK,
3030
options: options,
31-
completion: continuation.resume)
31+
completion: { continuation.resume(with: $0) })
3232
}
3333
}
3434

@@ -43,7 +43,7 @@ public extension ParseLinkedIn {
4343
try await withCheckedThrowingContinuation { continuation in
4444
self.login(authData: authData,
4545
options: options,
46-
completion: continuation.resume)
46+
completion: { continuation.resume(with: $0) })
4747
}
4848
}
4949
}
@@ -67,7 +67,7 @@ public extension ParseLinkedIn {
6767
accessToken: accessToken,
6868
isMobileSDK: isMobileSDK,
6969
options: options,
70-
completion: continuation.resume)
70+
completion: { continuation.resume(with: $0) })
7171
}
7272
}
7373

@@ -83,7 +83,7 @@ public extension ParseLinkedIn {
8383
try await withCheckedThrowingContinuation { continuation in
8484
self.link(authData: authData,
8585
options: options,
86-
completion: continuation.resume)
86+
completion: { continuation.resume(with: $0) })
8787
}
8888
}
8989
}

0 commit comments

Comments
 (0)