Let's say we have 2 decodable structs in Swift 5.5, and one of them has a property that contains an array of one of the structs:
struct MySecondDecodable: Decodable {
public let mySecondProperty: String
private enum CodingKeys: String, CodingKey {
case mySecondProperty
}
init(from decoder: Decoder) {
let values = try decoder.container(keyedBy: CodingKeys.self)
mySecondProperty = try values.decode(String.self, forKey: .mySecondProperty)
}
}
struct MyDecodable: Decodable {
public let myProperty: [MySecondDecodable]
private enum CodingKeys: String, CodingKey {
case myProperty
}
init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: CodingKeys.self)
myProperty = try values.decode([MySecondDecodable].self, forKey: .myProperty)
}
}
I cannot breakpoint on MySecondDecodable's init function. In fact, I cannot even see it's running.
Why is this happening? Why can't I breakpoint the initialization of every single MySecondDecodable in the array? Is there a way to do such a thing?
4
0
3.0k