Convert gregorian date to Hijri date
问题 The source code comes from: Hijri (islamic) calendar in swift التاريخ الهجري How can I convert string date to NSDate? I just put them together but it has some mistake with the output. let dateFormatter = NSDateFormatter() dateFormatter.dateFormat = "YYYY-MM-DD" let GregorianDate = dateFormatter.dateFromString("\(Yeartext1.text!)-\(Monthtext1.text!)-\(Daytext1.text!)") let islamic = NSCalendar(identifier: NSIslamicCalendar) let components = islamic?.components(NSCalendarUnit(rawValue: UInt.max