You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After making the change to cancel the search task, you probably noticed some annoying warnings like this.
Result of call to 'taskForGETRequest(url:responseType:completion:)' is unused
Ever since we added the return type, Xcode now shows warnings every time we call it without assigning something to the URLSessionDataTask it returns. But for the most part, we don't actually need to access the returned task.
A quick fix, is to add the @discardableResult annotation before the declaration of the taskForGETRequest function (this is an annotation just like adding @escaping before a closure). Doing so will silence the warnings.
The text was updated successfully, but these errors were encountered:
After making the change to cancel the search task, you probably noticed some annoying warnings like this.
Ever since we added the return type, Xcode now shows warnings every time we call it without assigning something to the
URLSessionDataTask
it returns. But for the most part, we don't actually need to access the returned task.A quick fix, is to add the
@discardableResult
annotation before the declaration of thetaskForGETRequest
function (this is an annotation just like adding@escaping
before a closure). Doing so will silence the warnings.The text was updated successfully, but these errors were encountered: