ios – Map Firestore Knowledge To Object Array Swift

0
8


I’m receiving information from Firestore within the present format;

[(key: "capacity", value: <__NSArrayM 0x600000bd8030>(
32GB,
64GB,
128GB
)
), (key: "condition", value: <__NSArrayM 0x600000bd8180>(
New,
Used
)
)]

Operate:

question.getDocuments { snapshot, error in
        guard let doc = snapshot?.paperwork else { return }
        let flatMap = doc.flatMap({ $0.information() })
        print(flatMap)
    }

I’m attempting to map this array of [[String: [String]]] into an array of my object resembling;

struct Object {
    var key: String
    var worth: [String]
}

How would I am going about doing this?

LEAVE A REPLY

Please enter your comment!
Please enter your name here