From f223e6f50d60b931762d7e0b75b6cbf4d1d45ed3 Mon Sep 17 00:00:00 2001 From: dsnallfot <72826201+dsnallfot@users.noreply.github.com> Date: Sun, 24 Mar 2024 21:20:59 +0100 Subject: [PATCH] Added 3 shortcut buttons on remotescreen (for low treatment, health log and carb counting) --- .../Application/Base.lproj/Main.storyboard | 172 +++++++++++++++--- .../RemoteViewController.swift | 21 +++ 2 files changed, 167 insertions(+), 26 deletions(-) diff --git a/LoopFollow/Application/Base.lproj/Main.storyboard b/LoopFollow/Application/Base.lproj/Main.storyboard index fb5c624a..b214be19 100644 --- a/LoopFollow/Application/Base.lproj/Main.storyboard +++ b/LoopFollow/Application/Base.lproj/Main.storyboard @@ -567,10 +567,10 @@ - + + + + + + + + + + @@ -664,12 +749,14 @@ + + - - + - + - + - + - + - + @@ -1047,7 +1158,7 @@ + + + + + + - + - + - + - + - + - + @@ -1128,14 +1245,14 @@ - + - + @@ -1195,7 +1312,7 @@ - + @@ -1321,7 +1438,7 @@ - + @@ -1375,13 +1492,16 @@ + + + diff --git a/LoopFollow/ViewControllers/RemoteViewController.swift b/LoopFollow/ViewControllers/RemoteViewController.swift index e490e5de..d78a508f 100644 --- a/LoopFollow/ViewControllers/RemoteViewController.swift +++ b/LoopFollow/ViewControllers/RemoteViewController.swift @@ -43,4 +43,25 @@ class RemoteViewController: UIViewController { let remoteSettingsViewController = storyboard!.instantiateViewController(withIdentifier: "remoteSettings") as! RemoteSettingsViewController self.present(remoteSettingsViewController, animated: true, completion: nil) } + + @IBAction func pillButtonTapped(_ sender: Any) { + let urlString = "shortcuts://run-shortcut?name=Remote%20Dextro" + if let url = URL(string: urlString) { + UIApplication.shared.open(url, options: [:], completionHandler: nil) + } + } + + @IBAction func calendarButtonTapped(_ sender: Any) { + let urlString = "shortcuts://run-shortcut?name=Hälsologg" + if let url = URL(string: urlString) { + UIApplication.shared.open(url, options: [:], completionHandler: nil) + } + } + + @IBAction func menuButtonTapped(_ sender: Any) { + let urlString = "shortcuts://run-shortcut?name=Räkna%20KH%20(Excel)" + if let url = URL(string: urlString) { + UIApplication.shared.open(url, options: [:], completionHandler: nil) + } + } }