lundi 8 août 2016

"Type 'task.Type' has no subscript members" error in Swift [closed]

This code gives me an error; Type 'task.Type' has no subscript members

This is my code:

struct task {
    var name = "Un-Named"
    var desc = "Un-Described"
}

class TaskManager: NSObject {

    var tasks = task[]()

    func addTask(name: String, desc: String){
        tasks.append(task(name: name, desc: desc))        
    }
}

Aucun commentaire:

Enregistrer un commentaire