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

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -