before Swift3, in a my project I used this function:
var components = (calendar as NSCalendar).components([.year, .monthSymbols, .firstWeekday, .timeZone, .hour, .minute], from: data_corrente)
Now I'm changing the project using swift 3 (xCode8 beta5) but I have this error:
Type 'NSCalendar.Unit has no member 'monthSymbol'
Can someone explain where is the problem and help me to solve it? I think is a migration problem
In Swift3 with Xcode8 beta.
You can use Calendar
instead of NSCalendar
as like this:
let calendar = Calendar.current
let component = calendar.dateComponents([.day,.month,.year], from: Date())
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With