Created
April 7, 2018 11:11
-
-
Save 3257/3b86c9ad7bcd0e8aed953b10d02df8e3 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 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