     }
 
     size = CGSize(
-      width:  ((map["size"] as? JSONDictionary)?["width"] as? Int) ?? 0,
-      height: ((map["size"] as? JSONDictionary)?["height"] as? Int) ?? 0
+      width:  ((map[.Size] as? JSONDictionary)?[.Width] as? Int) ?? 0,
+      height: ((map[.Size] as? JSONDictionary)?[.Height] as? Int) ?? 0
     )
   }
 

   - Parameter map: A JSON dictionary
  */
  public init(_ map: JSONDictionary) {
    title    <- map.property("title")
    subtitle <- map.property("subtitle")
    image    <- map.property("image")
    kind     <- map.property("type") ?? map.property("kind")
    action   <- map.property("action")
    meta     <- map.property("meta")

    if let relation = map["relations"] as? [String : [ViewModel]] {
      relations = relation
    }

    if let relations = map["relations"] as? [String : [JSONDictionary]] {
      var newRelations = [String : [ViewModel]]()
      relations.forEach { key, array in
        if newRelations[key] == nil { newRelations[key] = [ViewModel]() }

 A value type struct, it conforms to the Mappable protocol so that it can be instantiated with JSON
*/
public struct ViewModel: Mappable {

  public enum Key: String {
    case Index
    case Title
    case Subtitle
    case Image
    case Type
    case Kind
    case Action
    case Meta
    case Relations
    case Size
    case Width
    case Height

    var string: String {
      return rawValue.lowercaseString
    }
  }

  /// The index of the ViewModel when appearing in a list, should be computed and continuously updated by the data source
  public var index = 0
  /// The main representation of the ViewModel
