I want to take the JSON key names and add them into an array.
{
"name": "Battleaxe, tactical",
"price": 2650,
"level": 5,
"bulk": "1",
"special": ["Analog"],
"damage": "1d8 S",
"source": "Incident at Absalom Station",
"hands": 1,
"critical": "Wound",
"category": "Uncategorized",
"proficiency": "Advanced Melee"
}
With the JSON above I want to create and array in Swift:
let testArray: ["name", "price", "level"...]
I am still pretty new to playing with JSON in Swift and haven't found what I am looking for. Right now I am hard coding each array per object. I have a lot of different JSON files so being able to have something like this would help out alot.
question from:
https://stackoverflow.com/questions/65850311/swift-json-add-the-key-names-into-an-array 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…