From 08ab061bc65238cc6eb45b10b4428083255ad596 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Re=CC=81mi=20Hillairet?= Date: Fri, 18 Sep 2020 18:07:23 +0200 Subject: [PATCH] Add cancelConnect to BLEConnectionManager #6260 --- uCubeSampleApp/MenuTableViewController.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/uCubeSampleApp/MenuTableViewController.swift b/uCubeSampleApp/MenuTableViewController.swift index 3585403..0ce845b 100644 --- a/uCubeSampleApp/MenuTableViewController.swift +++ b/uCubeSampleApp/MenuTableViewController.swift @@ -76,7 +76,11 @@ class MenuTableViewController: AlertPresenterTableViewController { presentAlert(title: nil, message: "Disconnecting from \(device.name)...") deviceConnection.disconnect() } else { - presentAlert(title: nil, message: "Connecting to \(device.name)...") + presentAlert(title: nil, message: "Connecting to \(device.name)...", actions: [ + AlertAction(title: "Cancel", handler: { + BLEConnectionManager.shared.cancelConnect() + }) + ]) deviceConnection.connect() } }