From cc6b5dcc614f89cd7cfb2f0b738dff4e0ba6e521 Mon Sep 17 00:00:00 2001 From: SBiOSoftWhare Date: Tue, 3 May 2022 15:49:49 +0200 Subject: [PATCH] MXBeaconInfoSummaryProtocol: Add convenient property. --- Riot/Categories/MXBeaconInfoSummary.swift | 26 +++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Riot/Categories/MXBeaconInfoSummary.swift diff --git a/Riot/Categories/MXBeaconInfoSummary.swift b/Riot/Categories/MXBeaconInfoSummary.swift new file mode 100644 index 000000000..3d47a466c --- /dev/null +++ b/Riot/Categories/MXBeaconInfoSummary.swift @@ -0,0 +1,26 @@ +// +// Copyright 2022 New Vector Ltd +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +import Foundation +import MatrixSDK + +extension MXBeaconInfoSummaryProtocol { + + /// Indicate true if a beacon info summary can be displayed on a map + var isDisplayable: Bool { + return self.isActive && self.lastBeacon != nil + } +}