Created
June 22, 2018 18:39
-
-
Save gallaugher/bf81460d130f2f494b256bbbcbb5b601 to your computer and use it in GitHub Desktop.
Photo.swift's dictionary convenience initializer
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
| convenience init(dictionary: [String: Any]) { | |
| let description = dictionary["description"] as! String? ?? "" | |
| let postedBy = dictionary["postedBy"] as! String? ?? "" | |
| let date = dictionary["date"] as! Date? ?? Date() | |
| self.init(image: UIImage(), description: description, postedBy: postedBy, date: date, documentUUID: "") | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment