From cedba7ba8c6090bd2f8f0f28ad81ad60e37ef3b4 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Thu, 29 Feb 2024 16:34:55 -0600 Subject: [PATCH 1/4] added namespace for control Signed-off-by: Matt Bruce --- VDS/Components/TextFields/TextArea/TextView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VDS/Components/TextFields/TextArea/TextView.swift b/VDS/Components/TextFields/TextArea/TextView.swift index cc1567bf..ea96ed6e 100644 --- a/VDS/Components/TextFields/TextArea/TextView.swift +++ b/VDS/Components/TextFields/TextArea/TextView.swift @@ -10,7 +10,7 @@ import UIKit import Combine import VDSColorTokens -/// Will move this into a new file, need to talk with Scott/Kyle +@objc(VDSTextView) open class TextView: UITextView, ViewProtocol { //-------------------------------------------------- From 25058dd92de108c46d141e135b866d2dd4716834 Mon Sep 17 00:00:00 2001 From: Keerthy Date: Fri, 1 Mar 2024 12:41:13 +0530 Subject: [PATCH 2/4] self.isVisibleOnScreen for isActive --- VDS/Components/Loader/Loader.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VDS/Components/Loader/Loader.swift b/VDS/Components/Loader/Loader.swift index baf6ecdb..3b4c8ebd 100644 --- a/VDS/Components/Loader/Loader.swift +++ b/VDS/Components/Loader/Loader.swift @@ -80,7 +80,7 @@ open class Loader: View { super.updateView() icon.color = iconColorConfiguration.getColor(self) icon.customSize = size - if isActive { + if isActive, self.isVisibleOnScreen { startAnimating() } else { stopAnimating() From 6e8fe4ea91625d847489cadfe477eb00e1fabcbf Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Fri, 1 Mar 2024 09:14:13 -0600 Subject: [PATCH 3/4] use && instead of comma (,) if you don't use if let Signed-off-by: Matt Bruce --- VDS/Components/Loader/Loader.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VDS/Components/Loader/Loader.swift b/VDS/Components/Loader/Loader.swift index 3b4c8ebd..1cfb02c4 100644 --- a/VDS/Components/Loader/Loader.swift +++ b/VDS/Components/Loader/Loader.swift @@ -80,7 +80,7 @@ open class Loader: View { super.updateView() icon.color = iconColorConfiguration.getColor(self) icon.customSize = size - if isActive, self.isVisibleOnScreen { + if isActive && isVisibleOnScreen { startAnimating() } else { stopAnimating() From 1cce53922283de8dec505b47b6d14941028d88d1 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Fri, 1 Mar 2024 10:14:05 -0600 Subject: [PATCH 4/4] added layoutsubviews to call setNeedsUpdate Signed-off-by: Matt Bruce --- VDS/BaseClasses/Control.swift | 4 ++++ VDS/BaseClasses/View.swift | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/VDS/BaseClasses/Control.swift b/VDS/BaseClasses/Control.swift index e4ba8cde..cc2246aa 100644 --- a/VDS/BaseClasses/Control.swift +++ b/VDS/BaseClasses/Control.swift @@ -132,4 +132,8 @@ open class Control: UIControl, ViewProtocol, UserInfoable, Clickable { return true } + open override func layoutSubviews() { + super.layoutSubviews() + setNeedsUpdate() + } } diff --git a/VDS/BaseClasses/View.swift b/VDS/BaseClasses/View.swift index 89e5ce4b..a807c25c 100644 --- a/VDS/BaseClasses/View.swift +++ b/VDS/BaseClasses/View.swift @@ -86,4 +86,9 @@ open class View: UIView, ViewProtocol, UserInfoable { isEnabled = true } + open override func layoutSubviews() { + super.layoutSubviews() + setNeedsUpdate() + } + }