Scenario: I have a struct within a Struct that is used to hold JSON data.
Goal: I want to be be able to populate the sub struct via an init() for some UnitTesting work.
struct PortEligibility: Codable {
var myVar = ""
struct PortMobileNumber: Codable {
let one: String?
let two: String?
let three: String?
}
}
I've been toying about this but am lost:
I don't want to use a decoder.
Remedy?