On the process of migrating an iOS app to Swift 3.0. Here is one issue I am facing.
First the relevant code:
let calendar = NSCalendar.current,
calendCompo = calendar.components([.Year, .Month, .Day, .Hour, .Minute, .Second], fromDate: NSDate())
Second the problem:
I am getting this error message, for the second line:
Type of expression is ambiguous without more context
I also tried this code:
let calendar = NSCalendar.current,
calendCompo = calendar.components([.year, .month, .day, .hour, .minute, .second], fromDate: NSDate())
But it did not make any difference.
How do I need to modify the code to make it work? Thanks for any relevant tip.
The correct way to achieve that in Swift 3.0 is: