I am working on an app that notifies the user 5 minutes before the departure time. I'm using firebase as my database.
I've tried searching answers from the internet but the solutions are not working.
So here's the code in getting the departure hour and minute:
let hour = dict["DepartureHour"] as! NSNumber
let minute = dict ["DepartureMinute"] as! NSNumber
Putting it in a DateComponent:
var dateComponents = DateComponents()
dateComponents.hour = hour.intValue
dateComponents.minute = minute.intValue
Now I don't know what to do next, like how should I subtract 5 minutes from it. Please help me.