'Populating a SwiftUI view with output from a combine publisher [closed]

How do I get the data returned from a combine publisher, to a view?

enter image description here

There are many examples of this that show sink -> print. There is nothing that clearly shows how to do anything other than print.



Solution 1:[1]

@State var text = ""
var some View{
   Text(text)
    .padding()
    .onAppear(perform: {
        client.sink(receiveValue:{ value in 
        text = value
    }
  })
}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 AdR