0

I have a quite large (~200k) list of simple objects like:

struct City {
    let id: Int
    let name: String
    let lat: Double
    let lon: Double
}

and I want to embed in into my application. I believe, hardcoding it in a .swift file is not the best option. I've tried to embed it as a JSON file, but the loading speed is poor for this method. I've also tried a Message Pack serializer, but it seems to be as slow as JSON in my case.

What would be a proper way to embed it? I think, using Core Data would be too much for this situation. I think, with the fact that my data is so simple and I don't need any kind of backward compatibility it must be and easier solution.

Paboka
  • 422
  • 1
  • 5
  • 15

0 Answers0