Skip to content

Commit b2b15e5

Browse files
committed
feat(Picker): support ViewStyles
1 parent b26b19c commit b2b15e5

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

ios/components/Picker/PickerProps.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ public final class PickerProps: ObservableObject, Decodable {
88
@Published var options: [String] = []
99
@Published var pickerStyle: PickerStyle = .default
1010
@Published var disabled: Bool = false
11+
@Published public var style: StyleProps?
1112
// Events
1213
public var onChange: ((String) -> Void)?
1314

@@ -37,7 +38,7 @@ public final class PickerProps: ObservableObject, Decodable {
3738

3839
// Coding keys for decoding
3940
enum CodingKeys: String, CodingKey, CaseIterable {
40-
case label, selection, options, pickerStyle, disabled
41+
case label, selection, options, pickerStyle, disabled, style
4142
}
4243

4344
// Decodable initializer
@@ -54,6 +55,7 @@ public final class PickerProps: ObservableObject, Decodable {
5455
pickerStyle = .default // Default fallback
5556
}
5657
disabled = try container.decodeIfPresent(Bool.self, forKey: .disabled) ?? false
58+
style = try container.decodeIfPresent(StyleProps.self, forKey: .style)
5759
}
5860

5961
public init() {}
@@ -66,6 +68,7 @@ public final class PickerProps: ObservableObject, Decodable {
6668
case .options: options = other.options
6769
case .pickerStyle: pickerStyle = other.pickerStyle
6870
case .disabled: disabled = other.disabled
71+
case .style: style = other.style
6972
}
7073
}
7174
}

ios/components/Picker/PickerView.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@ public struct PickerView: View {
1919
props.onChange?(newValue)
2020
}
2121
)
22+
.applyStyles(props.style)
2223
}
2324
}

0 commit comments

Comments
 (0)