From 3f8285a74d3f3454933400ee73ce18b8e077e7b9 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Thu, 25 Aug 2022 10:59:57 -0500 Subject: [PATCH] added model reset Signed-off-by: Matt Bruce --- VDS/Classes/Control.swift | 3 +++ VDS/Classes/View.swift | 3 +++ 2 files changed, 6 insertions(+) diff --git a/VDS/Classes/Control.swift b/VDS/Classes/Control.swift index c0d3dcc8..de2a2dae 100644 --- a/VDS/Classes/Control.swift +++ b/VDS/Classes/Control.swift @@ -94,6 +94,9 @@ open class Control: UIControl, ModelHandlerable, ViewProto open func reset() { backgroundColor = .clear + if let model = model as? Resettable { + model.reset() + } } // MARK: - ViewProtocol diff --git a/VDS/Classes/View.swift b/VDS/Classes/View.swift index 15609f31..20cc0d6b 100644 --- a/VDS/Classes/View.swift +++ b/VDS/Classes/View.swift @@ -94,6 +94,9 @@ open class View: UIView, ModelHandlerable, ViewProtocol, R open func reset() { backgroundColor = .clear + if let model = model as? Resettable { + model.reset() + } } // MARK: - ViewProtocol