Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Source Model Class
class Source {
var id :String!
var name :String!
var description :String!
init?(dictionary :JSONDictionary) {
guard let id = dictionary["id"] as? String,
let name = dictionary["name"] as? String,
let description = dictionary["description"] as? String else {
return nil
} = id = name
self.description = description
init(viewModel :SourceViewModel) { = =
self.description = viewModel.body
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment