-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathUser.swift
More file actions
35 lines (31 loc) · 860 Bytes
/
User.swift
File metadata and controls
35 lines (31 loc) · 860 Bytes
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
//
// User.swift
// OpenLive
//
// Created by Tony Cioara on 2/22/18.
// Copyright © 2018 Agora. All rights reserved.
//
import Foundation
struct User: Codable {
let username: String
let email: String
let imageUrl: String
let followees: [Followee]
let followers: [String]
init(dict: [String: Any]) {
username = dict["username"] as! String
email = dict["email"] as! String
imageUrl = dict["imageUrl"] as! String
followees = dict["following"] as! [Followee]
followers = dict["followers"] as! [String]
}
func toDict() -> [String: Any] {
return [
"username": username as Any,
"email": email as Any,
"imageUrl": imageUrl as Any,
"following": followees as Any,
"followers": followers as Any
]
}
}