From 9cefb94bff14af3635cbf9e40182d538a6ba686f Mon Sep 17 00:00:00 2001 From: Kyle Matthew Hedden Date: Wed, 13 Jul 2022 23:22:44 -0400 Subject: [PATCH] restore PageBehaviorHandlerProtocol createBehaviors --- MVMCoreUI/Atomic/Templates/BaseTemplateModel.swift | 1 - .../Behaviors/Protocols/PageBehaviorHandlerProtocol.swift | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/MVMCoreUI/Atomic/Templates/BaseTemplateModel.swift b/MVMCoreUI/Atomic/Templates/BaseTemplateModel.swift index b60ca4bc..daa3aed1 100644 --- a/MVMCoreUI/Atomic/Templates/BaseTemplateModel.swift +++ b/MVMCoreUI/Atomic/Templates/BaseTemplateModel.swift @@ -31,7 +31,6 @@ import Foundation public var tabBarHidden: Bool = false public var tabBarIndex: Int? - // By default we mask until the server unlocks the page. public var shouldMaskScreenWhileRecording: Bool? //-------------------------------------------------- diff --git a/MVMCoreUI/Behaviors/Protocols/PageBehaviorHandlerProtocol.swift b/MVMCoreUI/Behaviors/Protocols/PageBehaviorHandlerProtocol.swift index ba0e2618..79f3364f 100644 --- a/MVMCoreUI/Behaviors/Protocols/PageBehaviorHandlerProtocol.swift +++ b/MVMCoreUI/Behaviors/Protocols/PageBehaviorHandlerProtocol.swift @@ -13,9 +13,10 @@ public protocol PageBehaviorHandlerProtocol { public extension PageBehaviorHandlerProtocol { /// Creates the behaviors and sets the variable. - func createBehaviors(for model: PageBehaviorHandlerModelProtocol, delegateObject: MVMCoreUIDelegateObject?) -> [PageBehaviorProtocol] { + mutating func createBehaviors(for model: PageBehaviorHandlerModelProtocol, delegateObject: MVMCoreUIDelegateObject?) { guard let behaviorModels = model.behaviors else { - return [] + behaviors = nil + return } var behaviors: [PageBehaviorProtocol] = [] @@ -31,8 +32,7 @@ public extension PageBehaviorHandlerProtocol { } } } - - return behaviors + self.behaviors = behaviors.count > 0 ? behaviors : nil } /// Executes all behaviors of type.