Learn Courses My Dashboard

App refresh background

In SwiftUI, I am adding an @UIApplicationDelegateAdaptor(AppDelegate.self) private var appDelegate to be able to run in the main View some UIKit methods like didFinishLaunchingWithOptions and BGTaskScheduler for background working.

Here I have an issue which I have no idea why it is there.:

That method: ContentModel.getStockData_FromFirebase(daily: true , weekly: false , monthy: false , query: “(a stock/crypto/[stocks]/[crypto]…)”) is fetching data from an API provider, and put into some @Published constants in ContentModel which is also an EnvironmentObject. I don’t know why I have that error, because ContentModel.getStockData_FromFirebase(…) is obviously an operation, or at least that is what I think it is…

( that function does not return anything )

That is the problem, the function doesn’t return anything therefore you can’t use it as a variable and pass it to another function

1 Like

OK, thank you!