There are 3 string variables
public var userLoginId : String?
public var searchString : String?
public var tableName : String?
I have a dic
I know this was asked a year ago. But I recently ran into this issue while writing unit tests. Basically I wrote up a mock JSON dictionary, used JSONSerialization to turn that into data, and passed that into a parsing object of sorts. In this particular test, however, the order had to be maintained or the test would fail, and the previously described method didn't do that. So what worked for me is instead of starting with a dictionary, I start with a test JSON string and encode that into data using utf8. When it's parsed into a dictionary, the order of the JSON string is maintained in parsed dictionary.