How to display xx minutes remaining using swift 2

let dateFormatter1 = NSDateFormatter()dateFormatter1.dateFormat = "yyyy-MM-dd'T'HH:mm:ssZ"dateFormatter1.timeZone = NSTimeZone.localTimeZone()let callDateUTC = dateFormatter1.dateFromString("2016-09-26T22:04:27Z")let archivedDateUTC = dateFormatter1.dateFromString("2016-09-26T22:08:27Z")let currentDate = NSDate()print("callDate : \(callDateUTC)")print("archivedDate : \(archivedDateUTC)")print("currentDate: \(currentDate)")let compareResult = archivedDateUTC?.compare(currentDate)if compareResult == NSComparisonResult.OrderedDescending {let diffDateComponents = NSCalendar.currentCalendar().components([NSCalendarUnit.Hour, NSCalendarUnit.Minute, NSCalendarUnit.Second], fromDate: currentDate, toDate: archivedDateUTC!, options: .MatchFirst)let countdown = "\(diffDateComponents.hour) hours \(diffDateComponents.minute) minutes remaining"print(countdown)}else{let diffDateComponents = NSCalendar.currentCalendar().components([NSCalendarUnit.Hour, NSCalendarUnit.Minute, NSCalendarUnit.Second], fromDate: callDateUTC!, toDate: currentDate, options: .MatchFirst)print("diff hour : \(diffDateComponents.hour)")if diffDateComponents.hour < 1 {let minutesRemaining = "\(diffDateComponents.minute) minutes ago"print(minutesRemaining)}else if(diffDateComponents.hour < 24){print("today")}else if(diffDateComponents.hour < 48){print("yesterday")}else{let dateFornatter2 = NSDateFormatter()dateFornatter2.dateFormat = "dd MMMM yyyy"dateFornatter2.timeZone = NSTimeZone.localTimeZone()let callDateInLocalTime = dateFornatter2.stringFromDate(callDateUTC!)print("\(callDateInLocalTime)")}}

Coding | Writing | Sharing. Co-founder Hepicar. IG www.instagram.com/akbarul.huda