Automattic / Gravatar-SDK-iOS

Gravatar SDK is a Swift library that allows you to integrate Gravatar features into your own iOS applications.
https://gravatar.com
Mozilla Public License 2.0
36 stars 1 forks source link

Fix concurrency warnings in `PersonalInfoField.swift` and RemoteSVGView.swift` #267

Closed pinarol closed 3 months ago

pinarol commented 3 months ago

Closes part of #136

Description

Fixes these warnings:

Screenshot 2024-06-04 at 13 27 30 Screenshot 2024-06-04 at 13 30 04

We also have a false positive warning, it looks like a compiler bug. The warning refers to the second parameter which is of type URLSessionTaskDelegate, we can’t see it here because it is nil by default, it would look like this if the second parameter didn't have a default value:

try await URLSession.shared.data(from: url, delegate: nil)

Even though we pass nil here, it complains that we are passing a non-sendable argument. So I'll leave this one as is for now. Let's see if this will be fixed in the next Swift version.

Screenshot 2024-06-04 at 14 08 20

Testing Steps

Demo app > Display remote SVG