David Bureš on Nostr: Hey guys, a quick Swift question about arrays. Suppose I have an array like this: ...
Hey guys, a quick Swift question about arrays.
Suppose I have an array like this:
`[["statistic": "account name", "value": " SomeAccount"], ["value": "2023-06-23 16:44:49 UTC", "statistic": "export time“]]`
And I want to transform it into a dictionary like this:
[
"account name": "SomeAccount",
"export time": "2023-06-23 16:44:49 UTC"
]
Basically, take every „statistic“ and turn it into a key, and turn every „value“ into a value for that key.
Any ideas?
#swift
Suppose I have an array like this:
`[["statistic": "account name", "value": " SomeAccount"], ["value": "2023-06-23 16:44:49 UTC", "statistic": "export time“]]`
And I want to transform it into a dictionary like this:
[
"account name": "SomeAccount",
"export time": "2023-06-23 16:44:49 UTC"
]
Basically, take every „statistic“ and turn it into a key, and turn every „value“ into a value for that key.
Any ideas?
#swift