Last active
November 4, 2017 17:35
-
-
Save pgpt10/53713e22de5515faebe41cea23cb9aef to your computer and use it in GitHub Desktop.
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
struct Photo: Codable | |
{ | |
//String, URL, Bool and Date conform to Codable. | |
var title: String | |
var url: URL | |
var isSample: Bool | |
//The Dictionary is of type [String:String] and String already conforms to Codable. | |
var metaData: [String:String] | |
//PhotoType and Size are also Codable types | |
var type: PhotoType | |
var size: Size | |
} | |
struct Size: Codable | |
{ | |
var height: Double | |
var width: Double | |
} | |
enum PhotoType: String, Codable | |
{ | |
case flower | |
case animal | |
case fruit | |
case vegetable | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment