There was no compiler warning in iOS 13 and Xcode 11. The "id" is needed for conformance to Identifiable. I'm using the Codable struct in a Swift UI List so Identifiable is needed. Making it mutable breaks the decoding. I may need to move the "id" up to the ViewModel struct and out of the Model struct. Again, it is only a warning, but slightly annoying.
If you do not have an "id" coming from a JSON payload that needs to be decoded, how do you conform to Identifiable?
Post
Replies
Boosts
Views
Activity
Thanks. If I make it mutable Decodable breaks because the API does not contain an "id" in the return. If there are other suggestions please let me know.