File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
Sources/ComponentsKit/RadioGroup/UIKit Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,12 @@ public class RadioGroupItemView<ID: Hashable>: UIView {
5757 self . addSubview ( self . radioView)
5858 self . radioView. addSubview ( self . innerCircle)
5959 self . addSubview ( self . titleLabel)
60+
61+ if #available( iOS 17 . 0 , * ) {
62+ self . registerForTraitChanges ( [ UITraitUserInterfaceStyle . self] ) { ( view: Self , _: UITraitCollection ) in
63+ view. handleTraitChanges ( )
64+ }
65+ }
6066 }
6167
6268 // MARK: Style
@@ -152,6 +158,26 @@ public class RadioGroupItemView<ID: Hashable>: UIView {
152158 completion: nil
153159 )
154160 }
161+
162+ // MARK: UIView Methods
163+
164+ public override func traitCollectionDidChange(
165+ _ previousTraitCollection: UITraitCollection ?
166+ ) {
167+ super. traitCollectionDidChange ( previousTraitCollection)
168+ self . handleTraitChanges ( )
169+ }
170+
171+ // MARK: Helpers
172+
173+ @objc private func handleTraitChanges( ) {
174+ Self . Style. radioView (
175+ self . radioView,
176+ itemVM: self . itemVM,
177+ groupVM: self . groupVM,
178+ isSelected: self . isSelected
179+ )
180+ }
155181}
156182
157183// MARK: - Style Helpers
You can’t perform that action at this time.
0 commit comments