-
Notifications
You must be signed in to change notification settings - Fork 89
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
Silence warnings for unused return type in taskForGETRequest. #7
Labels
moviemanagerchallenge
Task for "Improve the Movie Manager" Challenge
Comments
|
AsmaHero
added a commit
to AsmaHero/ios-nd-networking
that referenced
this issue
Jun 5, 2019
Silence warnings for unused return type in taskForGETRequest.
nihalerdal
added a commit
to nihalerdal/TheMovieManager
that referenced
this issue
May 27, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: