I'm trying to build app that shows to different dates, a start date and time along with an end date and time, i would like it to display the difference between date and time example (1 day 3 hours) then calculates a cost. As I'm new to swift i wanted to know if NSDate() or UIDatePicker is best option at the moment all i have is
let startDate = NSDate()
let endDate = NSDate()
let calendar = NSCalendar.currentCalendar()
let dateComponents = calendar.components(NSCalendarUnit.CalendarUnitHours, fromDate: start, toDate: enddt, options: nil)
let Hours= datecomponents.hours
println("Hours: \(Hours)")
Thanks in advance