In the process of migrating your iOS application to Swift 3.0. Here is one of the issues that I have encountered.
First, the corresponding code:
let calendar = NSCalendar.current,
calendCompo = calendar.components([.Year, .Month, .Day, .Hour, .Minute, .Second], fromDate: NSDate())
Secondly, the problem:
I get 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 that didn't make any difference.
How do I change the code to make it work? Thanks for any relevant feedback.
source
share