I am new to the combine world and have written a query that returns the results I need correctly. It's multi-step, but basically makes an api call over the network, parses the returned json and creates an array of records I need.
let results2: Publishers.Map<Publishers.ReceiveOn<Publishers.Decode<Publishers.Map<URLSession.DataTaskPublisher, JSONDecoder.Input>, Wrapper<Question>, JSONDecoder>, DispatchQueue>, [Question]>
I'm trying to rewrite a portion of my code and realize that I still don't quite grasp the ins and outs of parsing the results.
If you look at the datatype of results2 you will see the final portion contains an array of Question
. How do I assign this array to a variable, as in:
let finalAnswer: [Question] = turnThisIntoAnArray(results2)
If possible, I'd prefer a general answer to this general question, rather than providing all the code needed to recreate this specific string of publishers.
thanks