No se puede llamar al valor del tipo sin función 'Cadena'
Estoy tratando de pasar la variable ILTItem a mi ILTViewController, activada por AppDelegate.swift cuando el usuario inicia mi aplicación a través de un enlace profundo.
El código con el que tengo errores:
No se puede llamar al valor del tipo sin función 'Cadena'
en la línea donde definoilt
.
Aquí está el código que tengo en este momento:
let appDelegate = UIApplication.sharedApplication().delegate as! AppDelegate
var ilt = ILT(homeworkID: 1234, title: "History ILT", subject: "History", teacher: "Miss A Smith", teacherCode: "asmith", studentID: 12345, description: "Description....", due: 1450137600, status: "In Progress", hasAttachments: true)
var newVC = ILTViewController()
newVC.ILTitem = ilt
appDelegate.window?.addSubview(newVC.view)
¿Por qué podría ser esto? En mi clase ILTViewController tengo:
class ILTViewController: UIViewController {
// accept the incoming ILT struct
var ILTitem: ILT!
Declaración de la estructura:
struct ILT {
let homeworkID: Int
let title: String
let subject: String
let teacher: String
let teacherCode: String
let studentID: Int
let description: String
let due: Double
let status: String
let hasAttachments: Bool
}