let dateComponents = calendar.components(.DayCalendarUnit | .MonthCalendarUnit | .YearCalendarUnit, fromDate: date)
I got error:
'DayCalendarUnit' was deprecated in iOS version 8.0: Use NSCalendarUnitDay instead
But when I replace these names with those suggested by Apple
let dateComponents = calendar.components(NSCalendarUnitDay | NSCalendarUnitMonth | NSCalendarUnitYear, fromDate: date)
I get error:
Use of unresolved identifier 'NSCalendarUnitDay'