Skip to content

Commit 8ed7522

Browse files
authored
Missed a few casts during Swift 3 migration (#182)
1 parent c9d6ed6 commit 8ed7522

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

Loop/Managers/WatchDataManager.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ final class WatchDataManager: NSObject, WCSessionDelegate {
3939

4040
@objc private func updateWatch(_ notification: Notification) {
4141
guard
42-
let rawContext = (notification as NSNotification).userInfo?[LoopDataManager.LoopUpdateContextKey] as? LoopDataManager.LoopUpdateContext.RawValue,
42+
let rawContext = notification.userInfo?[LoopDataManager.LoopUpdateContextKey] as? LoopDataManager.LoopUpdateContext.RawValue,
4343
let context = LoopDataManager.LoopUpdateContext(rawValue: rawContext),
4444
case .tempBasal = context,
4545
let session = watchSession

Loop/View Controllers/PredictionTableViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ class PredictionTableViewController: UITableViewController, IdentifiableClass {
119119
var components = DateComponents()
120120
components.minute = 0
121121
let date = Date(timeIntervalSinceNow: -TimeInterval(hours: 1))
122-
charts.startDate = (calendar as NSCalendar).nextDate(after: date, matching: components, options: [.matchStrictly, .searchBackwards]) ?? date
122+
charts.startDate = calendar.nextDate(after: date, matching: components, matchingPolicy: .strict, direction: .backward) ?? date
123123

124124
let reloadGroup = DispatchGroup()
125125
var glucoseUnit: HKUnit?

Loop/View Controllers/StatusTableViewController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,12 @@ final class StatusTableViewController: UITableViewController, UIGestureRecognize
134134
var components = DateComponents()
135135
components.minute = 0
136136
let date = Date(timeIntervalSinceNow: -TimeInterval(hours: 6))
137-
charts.startDate = (calendar as NSCalendar).nextDate(after: date, matching: components, options: [.matchStrictly, .searchBackwards]) ?? date
137+
charts.startDate = calendar.nextDate(after: date, matching: components, matchingPolicy: .strict, direction: .backward) ?? date
138138
charts.glucoseDisplayRange = (
139139
min: HKQuantity(unit: HKUnit.milligramsPerDeciliterUnit(), doubleValue: 75),
140140
max: HKQuantity(unit: HKUnit.milligramsPerDeciliterUnit(), doubleValue: 225)
141141
)
142-
142+
143143
let reloadGroup = DispatchGroup()
144144
var glucoseUnit: HKUnit?
145145

0 commit comments

Comments
 (0)