File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Sources/SwiftCrossUI/Views Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -45,10 +45,10 @@ public struct ProgressView<Label: View>: View {
45
45
46
46
/// Creates a progress bar view. If `value` is `nil`, an indeterminate progress
47
47
/// bar will be shown.
48
- public init ( _ label: Label , value: Double ? ) {
48
+ public init < Value : BinaryFloatingPoint > ( _ label: Label , value: Value ? ) {
49
49
self . label = label
50
50
self . kind = . bar
51
- self . progress = value
51
+ self . progress = value. map ( Double . init )
52
52
}
53
53
}
54
54
@@ -69,10 +69,10 @@ extension ProgressView where Label == EmptyView {
69
69
70
70
/// Creates a progress bar view. If `value` is `nil`, an indeterminate progress
71
71
/// bar will be shown.
72
- public init ( value: Double ? ) {
72
+ public init < Value : BinaryFloatingPoint > ( value: Value ? ) {
73
73
self . label = EmptyView ( )
74
74
self . kind = . bar
75
- self . progress = value
75
+ self . progress = value. map ( Double . init )
76
76
}
77
77
}
78
78
@@ -93,10 +93,10 @@ extension ProgressView where Label == Text {
93
93
94
94
/// Creates a progress bar view. If `value` is `nil`, an indeterminate progress
95
95
/// bar will be shown.
96
- public init ( _ label: String , value: Double ? ) {
96
+ public init < Value : BinaryFloatingPoint > ( _ label: String , value: Value ? ) {
97
97
self . label = Text ( label)
98
98
self . kind = . bar
99
- self . progress = value
99
+ self . progress = value. map ( Double . init )
100
100
}
101
101
}
102
102
You can’t perform that action at this time.
0 commit comments