Skip to content

Commit 39e7d86

Browse files
authored
[LOOP-5188] optional VC (LoopKit#741)
1 parent f2f82b2 commit 39e7d86

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

Loop/View Controllers/RootNavigationController.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,20 @@ import LoopKitUI
1313
class RootNavigationController: UINavigationController {
1414

1515
/// Its root view controller is always StatusTableViewController after loading
16-
var statusTableViewController: StatusTableViewController! {
16+
var statusTableViewController: StatusTableViewController? {
1717
return viewControllers.first as? StatusTableViewController
1818
}
1919

2020
func navigate(to deeplink: Deeplink) {
2121
switch deeplink {
2222
case .carbEntry:
23-
statusTableViewController.presentCarbEntryScreen(nil)
23+
statusTableViewController?.presentCarbEntryScreen(nil)
2424
case .preMeal:
25-
statusTableViewController.presentPresets()
25+
statusTableViewController?.presentPresets()
2626
case .bolus:
27-
statusTableViewController.presentBolusScreen()
27+
statusTableViewController?.presentBolusScreen()
2828
case .customPresets:
29-
statusTableViewController.presentPresets()
29+
statusTableViewController?.presentPresets()
3030
}
3131
}
3232

@@ -41,7 +41,7 @@ class RootNavigationController: UINavigationController {
4141
popToRootViewController(animated: false)
4242
}
4343
default:
44-
statusTableViewController.restoreUserActivityState(activity)
44+
statusTableViewController?.restoreUserActivityState(activity)
4545
}
4646
}
4747

0 commit comments

Comments
 (0)