Organizational Research By

Surprising Reserch Topic

swift 2 0 calendar components error


swift 2 0 calendar components error  using -'ios,swift,nscalendar'

Hi I get this error in swift 2.0

Cannot invoke 'components' with an argument list of type '(NSCalendarUnit, fromDate: NSDate?, toDate: NSDate?, options: nil)'

var hoy = dataFormatter.stringFromDate(NSDate())
        var despues = dataFormatter.stringFromDate(fecha)
        var calHoy = dataFormatter.dateFromString(hoy)
        var calcDesp = dataFormatter.dateFromString(despues)
        let cal = NSCalendar.currentCalendar()
        let unit:NSCalendarUnit = .Day
        let components = cal.components(unit, fromDate: calcDesp, toDate: calHoy, options: nil)

    
asked Sep 16, 2015 by dahiyabecomp
0 votes
42 views



Related Hot Questions



Government Jobs Opening


...