From f1a775fc79fbaf462a429e05acf544d189b98d98 Mon Sep 17 00:00:00 2001 From: Paul Schmiedmayer Date: Fri, 15 Mar 2024 11:46:53 -0700 Subject: [PATCH] Fix Endless Loop for Tint Color Changes --- ResearchKit/Common/ORKCheckmarkView.m | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/ResearchKit/Common/ORKCheckmarkView.m b/ResearchKit/Common/ORKCheckmarkView.m index 463b69d12..aefe4cd32 100644 --- a/ResearchKit/Common/ORKCheckmarkView.m +++ b/ResearchKit/Common/ORKCheckmarkView.m @@ -105,22 +105,14 @@ + (UIImage *)checkedImageWithoutCircle { - (void)updateCheckView { if (_checked) { self.image = _checkedImage; - // FIXME: Need to be replaced. - if (@available(iOS 13.0, *)) { + if (![self.tintColor isEqual: ORKViewTintColor(self)]) { self.tintColor = ORKViewTintColor(self); - } else { - self.backgroundColor = [self tintColor]; - self.tintColor = UIColor.whiteColor; } } else { self.image = _uncheckedImage; - if (@available(iOS 13.0, *)) { + if (![self.tintColor isEqual: [UIColor systemGray3Color]]) { self.tintColor = [UIColor systemGray3Color]; - } else { - self.tintColor = nil; - self.image = nil; - self.backgroundColor = UIColor.clearColor; } } }