ios – onAppear for views created in a storyboard

[ad_1]

I’m utilizing a library, which is extra tailor-made in the direction of Swift UI, however I’m creating app primarily based on common Views and ViewControllers.
The item for that library have to be declared(not less than from my understanding) it as both @StateObject or @ObservableObject, I get the identical error for each:

Accessing StateObject’s object with out being put in on a View. It will create a brand new occasion every time.

From comparable points, the answer appears to be to make use of .onAppear(Accessing StateObject’s object with out being put in on a View. It will create a brand new occasion every time – SwiftUI), however I’m misplaced on the way to name .onAppear for an @IBOutlet
Is there a technique to name .onAppear for a view, which is said as:

@IBOutlet var hostView: CPTGraphHostingView!

?

[ad_2]

Leave a Reply