Here’s short block of swift code that counts the number of days between two dates then pops an alert out to the UI. The start date is a random date in the past which starts out as a String. I used a NSDateFormatter to convert it to what the NSCalendar wants. The end date was the current date. The alert isn’t formatted, but gets the point across.