diff --git a/MVMCoreUI/BaseControllers/ViewController.swift b/MVMCoreUI/BaseControllers/ViewController.swift index dddb918e..fe7eee30 100644 --- a/MVMCoreUI/BaseControllers/ViewController.swift +++ b/MVMCoreUI/BaseControllers/ViewController.swift @@ -148,12 +148,10 @@ import MVMCore ///Check with behavior if it can continue do{ - let conditionSatisfied = try executeThrowingBehaviors {(behavior: PageMoleculeTransformationBehavior) in + let allFinishedProcessingLoad = try executeThrowingBehaviors {(behavior: PageMoleculeTransformationBehavior) in return try behavior.shouldFinishProcessingLoad(loadObject) } - if conditionSatisfied == false { - return conditionSatisfied - } + guard allFinishedProcessingLoad else { return false } } catch let behaviorError { if let errorObject = MVMCoreErrorObject.createErrorObject(for: behaviorError, location: MVMCoreLoadHandler.sharedGlobal()?.errorLocation(forRequest: loadObject)) { error.pointee = errorObject diff --git a/MVMCoreUI/Behaviors/Protocols/PageBehaviorHandlerProtocol.swift b/MVMCoreUI/Behaviors/Protocols/PageBehaviorHandlerProtocol.swift index b0d49b69..9e5c6a6d 100644 --- a/MVMCoreUI/Behaviors/Protocols/PageBehaviorHandlerProtocol.swift +++ b/MVMCoreUI/Behaviors/Protocols/PageBehaviorHandlerProtocol.swift @@ -46,6 +46,6 @@ public extension PageBehaviorHandlerProtocol { } func executeThrowingBehaviors(_ behaviourBlock: (_ behavior: T) throws -> Bool) throws -> Bool { - return try behaviors?.compactMap({$0 as? T}).allSatisfy({ return try behaviourBlock($0) }) ?? false + return try behaviors?.compactMap({$0 as? T}).allSatisfy({ return try behaviourBlock($0) }) ?? true } }