I have a date that I need to split in some components. for example
let components = NSCalendarUnit.CalendarUnitDay | NSCalendarUnit.CalendarUnitHour
let date = c
You're going to need to make another variable called "calendar" (NSCalendar object) and using the init "currentCalendar" method. Once you have the calendar object defined, call the method under calendar rangeOfUnit:NSWeekCalendarUnit inUnit:NSMonthCalendarUnit forDate:date. Then make a NSInteger called amountOfWeeks equal to the range the above function returns. The length of the range the function returns will be the number of weeks in that month.