so i have a class swift file that has a UserAccount class like this
class UserAccount{
var userName: String!
var email: String!
var instaGram: String!
var timeCreated: String!
var like: String!
var role: String!
var active: String!
var id: String!
init(userName: String, email: String, instaGram: String, timeCreated: String, like: String, role: String, active: String, id: String){
self.userName = userName
self.email = email
self.instaGram = instaGram
self.timeCreated = timeCreated
self.like = like
self.role = role
self.active = active
self.id = id
}
}
i have login view controller where i get the class variables and do my json and assign their values like this :
var userAcount = [UserAccount]() // Array Of Object
var user = UserAccount(userName: "", email: "", instaGram: "", timeCreated: "", like: "", role: "", active: "", id: "") //Init of Object
This is where i get my Json and add its value to its corresponding user class varible, i do this on my login view controller:
self.user.userName = userData.value(forKey: "userName") as! String
self.user.email = userData.value(forKey: "email") as! String
self.user.instaGram = userData.value(forKey: "instaGram") as! String
self.user.timeCreated = userData.value(forKey: "timeCreated") as! String
self.user.role = userData.value(forKey: "role") as! String
self.user.like = userData.value(forKey: "likes") as! String
self.user.id = userData.value(forKey: "id") as! String
self.user.active = userData.value(forKey: "active") as! String
this is where i append the information to my class array:
self.userAcount.append(self.user)
now my problem is that i dont know how to display the information in the UserAccount class on other view controllers, example the user profile view controller, is my first time working with users and profile, any help would be appreciated it, thank you