From 003b0d1c4a2f4be066c8927da5bcd786260a0901 Mon Sep 17 00:00:00 2001 From: Nathan Racklyeft Date: Tue, 20 Sep 2016 23:05:11 -0700 Subject: [PATCH] Missed a few casts during Swift 3 migration --- Loop/Managers/WatchDataManager.swift | 2 +- Loop/View Controllers/PredictionTableViewController.swift | 2 +- Loop/View Controllers/StatusTableViewController.swift | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Loop/Managers/WatchDataManager.swift b/Loop/Managers/WatchDataManager.swift index 97c6f4f68f..2a144434ae 100644 --- a/Loop/Managers/WatchDataManager.swift +++ b/Loop/Managers/WatchDataManager.swift @@ -39,7 +39,7 @@ final class WatchDataManager: NSObject, WCSessionDelegate { @objc private func updateWatch(_ notification: Notification) { guard - let rawContext = (notification as NSNotification).userInfo?[LoopDataManager.LoopUpdateContextKey] as? LoopDataManager.LoopUpdateContext.RawValue, + let rawContext = notification.userInfo?[LoopDataManager.LoopUpdateContextKey] as? LoopDataManager.LoopUpdateContext.RawValue, let context = LoopDataManager.LoopUpdateContext(rawValue: rawContext), case .tempBasal = context, let session = watchSession diff --git a/Loop/View Controllers/PredictionTableViewController.swift b/Loop/View Controllers/PredictionTableViewController.swift index 1ca479ae9a..adbd546ae9 100644 --- a/Loop/View Controllers/PredictionTableViewController.swift +++ b/Loop/View Controllers/PredictionTableViewController.swift @@ -119,7 +119,7 @@ class PredictionTableViewController: UITableViewController, IdentifiableClass { var components = DateComponents() components.minute = 0 let date = Date(timeIntervalSinceNow: -TimeInterval(hours: 1)) - charts.startDate = (calendar as NSCalendar).nextDate(after: date, matching: components, options: [.matchStrictly, .searchBackwards]) ?? date + charts.startDate = calendar.nextDate(after: date, matching: components, matchingPolicy: .strict, direction: .backward) ?? date let reloadGroup = DispatchGroup() var glucoseUnit: HKUnit? diff --git a/Loop/View Controllers/StatusTableViewController.swift b/Loop/View Controllers/StatusTableViewController.swift index 675dafe670..ee0be4ce7b 100644 --- a/Loop/View Controllers/StatusTableViewController.swift +++ b/Loop/View Controllers/StatusTableViewController.swift @@ -134,12 +134,12 @@ final class StatusTableViewController: UITableViewController, UIGestureRecognize var components = DateComponents() components.minute = 0 let date = Date(timeIntervalSinceNow: -TimeInterval(hours: 6)) - charts.startDate = (calendar as NSCalendar).nextDate(after: date, matching: components, options: [.matchStrictly, .searchBackwards]) ?? date + charts.startDate = calendar.nextDate(after: date, matching: components, matchingPolicy: .strict, direction: .backward) ?? date charts.glucoseDisplayRange = ( min: HKQuantity(unit: HKUnit.milligramsPerDeciliterUnit(), doubleValue: 75), max: HKQuantity(unit: HKUnit.milligramsPerDeciliterUnit(), doubleValue: 225) ) - + let reloadGroup = DispatchGroup() var glucoseUnit: HKUnit?