Created
January 17, 2017 16:29
-
-
Save vitorventurin/7f5ba22fd81ca003e0cf726d5064b592 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
// | |
// Product | |
// | |
// Created by Vitor Venturin Linhalis. | |
// Copyright © 2016 Vitor Venturin Linhalis. All rights reserved. | |
// | |
import Foundation | |
import Mapper | |
struct Place : Mappable { | |
var id: String! | |
var name: String! | |
var vicinity: String? | |
var iconURL: String? | |
var rating: Double? | |
var photos: [Photo]? | |
init(map: Mapper) throws { | |
try id = map.from("id") | |
try name = map.from("name") | |
vicinity = map.optionalFrom("vicinity") | |
iconURL = map.optionalFrom("icon") | |
rating = map.optionalFrom("rating") | |
if rating == nil { | |
rating = 0.0 | |
} | |
photos = map.optionalFrom("photos") | |
} | |
init() { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment