Skip to content

Commit bb1bdc2

Browse files
committed
Update package
1 parent 53195c3 commit bb1bdc2

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

Sources/Intermodular/Helpers/SwiftUI/View.tintColor.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,12 @@ extension EnvironmentValues {
2323

2424
extension View {
2525
/// Sets the tint color of the elements displayed by this view.
26-
@inlinable
26+
@ViewBuilder
2727
public func tintColor(_ color: Color?) -> some View {
28-
environment(\.tintColor, color)
28+
if #available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *) {
29+
self.tint(color).environment(\.tintColor, color)
30+
} else {
31+
self.environment(\.tintColor, color)
32+
}
2933
}
3034
}

Sources/Intramodular/Progress/ActivityIndicator.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@ extension ActivityIndicator: UIViewRepresentable {
5050
}
5151

5252
public func updateUIView(_ uiView: UIViewType, context: Context) {
53+
assignIfNotEqual(.init(style), to: &uiView.style)
54+
5355
uiView.color = tintUIColor ?? context.environment.tintColor?.toUIColor()
54-
uiView.style = .init(style)
5556
uiView.tintColor = tintUIColor ?? context.environment.tintColor?.toUIColor()
5657

5758
if !context.environment.isEnabled && uiView.isAnimating {

0 commit comments

Comments
 (0)