Skip to content

Instantly share code, notes, and snippets.

@phucnm
Created August 11, 2017 15:47
Show Gist options
  • Select an option

  • Save phucnm/117aa772c5078f1c2a61ef2b854ac5fa to your computer and use it in GitHub Desktop.

Select an option

Save phucnm/117aa772c5078f1c2a61ef2b854ac5fa to your computer and use it in GitHub Desktop.
class Post: Mappable {
var postId: String?
var title: String?
var content: String?
var author: String?
var likes: [String]?
func mapping(map: Map) {
postId <- map[Post.firebaseIdKey]
title <- map["title"]
content <- map["content"]
author <- map["author"]
likes <- (map["likes"], DictionaryKeyTransform())
}
required init?(map: Map) { }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment