I am a beginner with swift and I'm trying to complete my first app. While I was typing the code, it showed me this:
Cannot assign value of type 'NSDate' to type 'Date?
at
newBirthday.birthdate = birthdate as NSDate
I tried writing statements for making that line of code work but it wouldn't. Every time now I am running it, I would get 6 errors.
let newBirthday = Birthday(context: context)
newBirthday.firstName = firstName
newBirthday.lastName = lastName
newBirthday.birthdayGift = birthdayGift
newBirthday.birthdate = birthdate as NSDate
newBirthday.birthdayID = UUID().uuidString