I am getting an error in Xcode, and I don't know why. Please Help :D : Me and my Friend are working on a project for code and we are getting this error. This is the exact code we told to use however we always get an error. I'm not really sure how to resolve this. For the line that says var tasks = task ()[] it keeps saying that "type 'task' has no subscript members". How can we fix this?


       import UIKit

    var taskMgr: TaskManager = TaskManager ()

    struct task
    {
    var name = "Unnamed"
    var desc = "Undescribed"
    }

    class TaskManager: NSObject{
    
    var tasks = task ()[]
    
       func addTask(name: String, desc: String)
    {
    self.tasks(task (name: name, desc: desc))!
    }

    }



