swift2 - Xcode 7: Can't use CalendarUnitMonth in Swift 2.0, Xcode 7 -
i using swift2.
i used code:
let calendar = nscalendar.currentcalendar() let components = calendar.components(.calendarunitmonth | .calendarunitday, fromdate: thedate)
i getting error: could not find member 'calendarunitmonth'
check swift 2 documentation , search optionsettype
(adopted nscalendarunit
). can use in way:
let calendar = nscalendar.currentcalendar() let components = calendar.components([.month, .day], fromdate:nsdate())
Comments
Post a Comment