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 {
4545
4646 /// Creates a progress bar view. If `value` is `nil`, an indeterminate progress
4747 /// bar will be shown.
48- public init ( _ label: Label , value: Double ? ) {
48+ public init < Value : BinaryFloatingPoint > ( _ label: Label , value: Value ? ) {
4949 self . label = label
5050 self . kind = . bar
51- self . progress = value
51+ self . progress = value. map ( Double . init )
5252 }
5353}
5454
@@ -69,10 +69,10 @@ extension ProgressView where Label == EmptyView {
6969
7070 /// Creates a progress bar view. If `value` is `nil`, an indeterminate progress
7171 /// bar will be shown.
72- public init ( value: Double ? ) {
72+ public init < Value : BinaryFloatingPoint > ( value: Value ? ) {
7373 self . label = EmptyView ( )
7474 self . kind = . bar
75- self . progress = value
75+ self . progress = value. map ( Double . init )
7676 }
7777}
7878
@@ -93,10 +93,10 @@ extension ProgressView where Label == Text {
9393
9494 /// Creates a progress bar view. If `value` is `nil`, an indeterminate progress
9595 /// bar will be shown.
96- public init ( _ label: String , value: Double ? ) {
96+ public init < Value : BinaryFloatingPoint > ( _ label: String , value: Value ? ) {
9797 self . label = Text ( label)
9898 self . kind = . bar
99- self . progress = value
99+ self . progress = value. map ( Double . init )
100100 }
101101}
102102
You can’t perform that action at this time.
0 commit comments