Post

Replies

Boosts

Views

Activity

Swift Dictionary order does not match JSON file
I'm working on parsing a JSON file into a dictionary: // JSON Payload File { "orderPlaced": "done", "prep": "pending", "shipped" : "pending" }Here is my code to make a dictionary from that file: if let path = Bundle.main.path(forResource: "JSONPayload", ofType: "json") { do { // Data from JSON file path let data = try Data(contentsOf: URL(fileURLWithPath: path), options: []) // JSON dicrtionary being made let json = try JSONSerialization.jsonObject(with: data) as! [String: Any] print(json) } catch let jsonErr { print("err", jsonErr) }Expected output: ["orderPlaced": done, "prep": pending, "shipped": pending]The actual output is: ["shipped": pending, "orderPlaced": done, "prep": pending]Is there a way I can re-order my dictionary or have it ordered from the start. I'm assuming the latter request might not be doable since dictionaires from my understanding are un-ordered. Maybe the only thing I can do is re-order after the dictionary is made, but how would i do that? Do I have to modify my JSON file and the Swift code or just one or ther other?
Topic: UI Frameworks SubTopic: UIKit Tags:
10
0
8.8k
Aug ’18
Is Apple CloudKit Compliant with HIPPA?
Hi, So I have been recently work on some research for a Health Care application where HIPPA compliance is a requirement. I had done research into FireBase and that seemed good, but as of May 2018 it is not HIPPA compliant. I was looking around and Apple CloudKit seems like a good option, however I could not find any information from Apple's developer pages about CloudKit on whether it was HIPPA compliant or not?
3
1
2.5k
Jul ’18