-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTodo.swift
45 lines (34 loc) · 888 Bytes
/
Todo.swift
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//
// Todo.swift
// SwiftRestful iOS
//
// Created by Mani Moayedi on 12/4/18.
// Copyright © 2018 Mani Moayedi. All rights reserved.
//
import Foundation
import SwiftRestful
class Todo:NamingRitchJsonableBase, Jsonable{
var title:String!
var body:String!
var userId:Int!
var id:Int!
required override init() {
}
required init(title:String! , body:String , userId:Int) {
super.init()
self.title=title
self.body=body
self.userId=userId
self.id=0
}
required init(id:Int) {
super.init()
self.id=id
}
func load(jsonData: JsonMediumType!) {
self.title = getString(jsonData, "title")
self.body = getString(jsonData, "body")
self.userId = getInt(jsonData, "userId")
self.id = getInt(jsonData, "id")
}
}