【发布时间】:2016-12-17 12:55:18
【问题描述】:
这是我的代码。但是一个错误说,不能使用类型参数列表调用 dateComponent...
let fromDate = NSDate(timeIntervalSince1970: TimeInterval(tweetsArray[indexPath.row].timestamp)!)
let toDate = NSDate()
let components : NSCalendar.Unit = [.second, .minute, .hour, .day, .weekOfMonth]
let differenceOfDate = NSCalendar.current.dateComponents(components, from: fromDate, to: toDate)
【问题讨论】:
标签: swift swift3 nsdate nscalendar