Created
April 21, 2019 21:06
-
-
Save Rashidium/2006755dcbefcb9a296f1f85f1b27669 to your computer and use it in GitHub Desktop.
Decodable Coupon struct
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
struct Coupon: Decodable { | |
var id: String = "" | |
var name: String = "" | |
var no: String = "" | |
var isOpen: Bool = false | |
var matches: [PMatches] = [] // PMatches is also a decodable struct. | |
enum CodingKeys: String, CodingKey { | |
case id = "cpnid", name = "couponname", no = "couponno", matches, isOpen = "iscouponopen" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment