Skip to content

Instantly share code, notes, and snippets.

@VictorAlbertos
Created June 3, 2015 14:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save VictorAlbertos/4a312ccb2f9da5f4b7fb to your computer and use it in GitHub Desktop.
Save VictorAlbertos/4a312ccb2f9da5f4b7fb to your computer and use it in GitHub Desktop.
import Foundation
import ObjectMapper
class News : Mappable {
var id: Int!
var username : String!
var date: String!
var share_url: String!
var image: String!
var title: String!
var text: String!
required init?(_ map: Map) {
mapping(map)
}
func mapping(map: Map) {
id <- map["id"]
date <- map["date"]
share_url <- map["share_url"]
image <- map["image"]
title <- map["title"]
text <- map["best_friend"]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment