Bom dia.
Estou com problema ao tentar inicializar uma classe que tem outra classe como parâmetro.
Essas são as classes:
class UsersTaskCell {
let user:User;
var lastUser:User;
var lastTask:Task;
init(user:User, lastUser:User, lastTask:Task){
self.user = user;
self.lastUser = lastUser;
self.lastTask = lastTask;
}
}
class Task{
let name:String;
var lastChange:NSDate;
init(name:String){
self.name = name;
self.lastChange = NSDate();
}
}
class User{
let name:String;
let photo:String;
init(name: String, photo: String){
self.name = name;
self.photo = photo;
}
}
Isso é o que eu tento fazer:
let user1 = User(name: "User1", photo: "user1");
let user2 = User(name: "User2", photo: "user2");
let task1 = Task(name: "Task #1");
let cell1 = UsersTaskCell(user: user1, lastUser: user2, lastTask: task1);
O erro que aparece é:
'NomeDoController.Type' does not have a member named user1