I am trying to add magical records data to todays extension but when i am call the fetch request data showing error writing Use of unresolved identifier so what i have to do to get data to my todays extensions?

class TodayViewController: UIViewController, NCWidgetProviding {

    @IBOutlet weak var todaysLbl: UILabel!
    @IBOutlet weak var subtaskLbl: UILabel!
    override func viewDidLoad() {
        super.viewDidLoad()

    }

    override func viewWillAppear(_ animated: Bool) {
        super .viewWillAppear(animated)
        let dateFormator = DateFormatter()
        dateFormator.dateFormat = "dd.MM.yyyy"
        if let data = TODOList.mr_findFirst(with: NSPredicate(format: "date == %@", dateFormator.string(from: Date()))) as? TODOList{
            todaysLbl.text = data.taskName

        }

    }

0 Answers