Skip to content

Instantly share code, notes, and snippets.

@3257
Created April 7, 2018 11:11
Show Gist options
  • Save 3257/3b86c9ad7bcd0e8aed953b10d02df8e3 to your computer and use it in GitHub Desktop.
Save 3257/3b86c9ad7bcd0e8aed953b10d02df8e3 to your computer and use it in GitHub Desktop.
import Foundation
struct Unicorn {
let imagePath: String
let addedBy: String
let seenAt: String
// Standard initializer
init(imagePath: String, addedBy: String, seenAt: String) {
self.imagePath = imagePath
self.addedBy = addedBy
self.seenAt = seenAt
}
// Func to make writing to database more convenient
func toAnyObject() -> Any {
return [
"imagePath": imagePath,
"addedBy": addedBy,
"seenAt": seenAt
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment