Skip to content

refactor: Improve async methods to remove warnings #198

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 14, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
nit
  • Loading branch information
cbaker6 committed May 14, 2025
commit 60b72ccd28b2db5d26cd8ebee0054e7c94fbe079
25 changes: 11 additions & 14 deletions Sources/ParseSwift/Types/ParseAnalytics+async.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,17 @@ public extension ParseAnalytics {
- parameter options: A set of header options sent to the server. Defaults to an empty set.
- throws: An error of type `ParseError`.
*/
static func trackAppOpened(launchOptions: [UIApplication.LaunchOptionsKey: Any],
at date: Date? = nil,
options: API.Options = []) async throws {

let result = try await withCheckedThrowingContinuation { continuation in
Self.trackAppOpened(launchOptions: launchOptions,
at: date,
options: options,
completion: { continuation.resume(with: $0) })
}
if case let .failure(error) = result {
throw error
}

static func trackAppOpened(
launchOptions: [UIApplication.LaunchOptionsKey: Any],
at date: Date? = nil,
options: API.Options = []
) async throws {
try await withCheckedThrowingContinuation { continuation in
Self.trackAppOpened(launchOptions: launchOptions,
at: date,
options: options,
completion: { continuation.resume(with: $0) })
}
}

#endif
Expand Down
Loading