|
|
| Previous ID |
SR-1840 |
| Radar |
None |
| Original Reporter |
Maximilian (JIRA User) |
| Type |
Bug |
Environment
Xcode 8
Additional Detail from JIRA
|
|
| Votes |
0 |
| Component/s |
Foundation |
| Labels |
Bug, StarterBug |
| Assignee |
None |
| Priority |
Medium |
md5: 6bc90e23895979b0ef040b6445dfcae0
Issue Description:
The Calendar function
public func range(of unit: Calendar.Unit, start datep: AutoreleasingUnsafeMutablePointer<NSDate?>?, interval tip: UnsafeMutablePointer<TimeInterval>?, for date: Date) -> Bool
has a incorrect type for the start parameter. It should be Date but is instead NSDate. This is how some code looks using this function.
func numberOfDaysUntilDate() -> NSInteger {
let units: Calendar.Unit = [.day]
var fromDate: NSDate?
var toDate: NSDate?
var duration: TimeInterval = 0
calendar.range(of: units, start: &fromDate, interval: &duration, for: Date())
calendar.range(of: units, start: &toDate, interval: &duration, for: self)
let components = calendar.components(units, from: fromDate as! Date, to: toDate as! Date, options: Calendar.Options(rawValue: 0))
return components.day!
}
Environment
Xcode 8
Additional Detail from JIRA
md5: 6bc90e23895979b0ef040b6445dfcae0
Issue Description:
The Calendar function
has a incorrect type for the start parameter. It should be Date but is instead NSDate. This is how some code looks using this function.