Skip to content

Instantly share code, notes, and snippets.

@ttepasse
Created February 4, 2015 16:24
Show Gist options
  • Save ttepasse/f0740c8accc65cd4d622 to your computer and use it in GitHub Desktop.
Save ttepasse/f0740c8accc65cd4d622 to your computer and use it in GitHub Desktop.
import UIKit
let cal = NSCalendar(calendarIdentifier: NSGregorianCalendar)!
let now = NSDate()
var firstDay = NSDateComponents()
firstDay.day = 1
cal.nextDateAfterDate(now, matchingComponents: firstDay, options: NSCalendarOptions.SearchBackwards)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment