We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Xcode 8
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! }
The text was updated successfully, but these errors were encountered:
Comment by Caleb Davenport (JIRA)
I think this can be marked as resolved as these functions were marked unavailable in this commit.
Sorry, something went wrong.
Comment by Magalie Allard (JIRA)
Hi Maximilian (JIRA User), I encountered the same issue today while converting CareKit to Xcode8. Try using this function instead:
https://developer.apple.com/reference/foundation/calendar/2293465-dateinterval
Comment by Daniel Phillips (JIRA)
PinkYukata (JIRA User) thanks for that I was having the exact same problem and I couldn't understand where this method went in `Calendar`
Can this issue be closed?
public func dateInterval(of component: Component, start: inout Date, interval: inout TimeInterval, for date: Date) -> Bool
I guess that this issue is no longer relevant
No branches or pull requests
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.
The text was updated successfully, but these errors were encountered: