Learn Courses My Dashboard

Error YouTube App (SwiftUI) lesson 4: Missing argument label

I am facing an error for YouTube App (SwiftUI) - lesson 4, my code matches the code in the downloaded assets for VideoPreview.swift file along with what is in the video. However I am getting two errors and it will not build.


Missing argument label ‘url:’ in call

Missing argument labels ‘url:data:’ in call

My App was launching up until checking the cache before downloading data and saving the data cache. I have done the same steps as in the video. See attached screenshot

In CacheManager.swift I was missing the “_” before url and data.

I had:
( url: String, data: Data?)

This is the correct way:
(_ url: String, _ data: Data?)

This resolves the issue.