Fixtures.swift 429 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
//
//  Fixtures.swift
//  Api
//
//  Created by Mauro Bender on 13/8/16.
//  Copyright © 2016 CocoaPods. All rights reserved.
//

import Api

struct Item {
	let id: Int
	let name: String
}

extension Item: JSONSerializable {
	init(fromJSON json: [String : AnyObject]) {
		self.id   = json[ "id" ] as! Int
		self.name = json[ "name" ] as! String
	}
	
	func toJSON() -> [String : AnyObject] {
		return [ String: AnyObject ]()
	}
}