Lacking argument for parameter ‘from’ in name. Insert ‘from <Decoder>

[ad_1]

I’ve a struct which verify codable protocol.

public struct FlightDTO {
   public var flightName: String = ""
   public var PilotName: String = ""
   public var copilotName: String = ""
   public var totalCrewMem: Int = 0
}

extension FlightDTO: Codable {
 
 enum CodingKeys: String, CodingKey {
 case flightName
 case PilotName
 case copilotName
 case totalCrewMem
 }
 }

once I create object of struct it give me this initialiser.

This struct is in swift bundle and I’m initialising it from the app.

  var flightData = FlightDTO(from: <#Decoder#>)

I’m not certain what to move in decoder.

[ad_2]

Leave a Reply

Your email address will not be published. Required fields are marked *