Post not yet marked as solved
Click to stop watching this thread.
You have stopped watching this post. Click to start watching again.
contentPostList.repliesup-voted.tooltip
There is no error per se. My doubt is about how to dynamically use swiftui on the fly. To give an idea on the flow:
// MyApp.swift
import SwiftUI
@main
struct MyApp: App {
let obj = MyWorkerClass ()
init ()
{
obj.callEntryPoint ()
}
var body: some Scene {
WindowGroup {
ContentView ()
}
}
}
// ContentView.swift
import SwiftUI
struct ContentView: View {
var body: some View {
VStack {
Image(systemName: "globe")
.imageScale(.large)
.foregroundColor(.accentColor)
Text("Hello, world!")
}
.padding()
}
}
// MyWorkerClass.swift
class MyWorkerClass
{
func callEntyPoint ()
{
// Switch to a worker thread and do some operations
DispatchQueue.global(qos: .background).async {
// Once the operations are done, Show some UI change on the Main thread
DispatchQueue.main.async {
// Create a new Label on the screen
}
}
}
}