实现封装 SwiftUI Picker 控件,达到通过构造不同类型的数据,就能渲染对应类型的 Picker。(The SwiftUI Picker control is encapsulated, so that by constructing different types of data, the corresponding type of Picker can be rendered.)
Step1 Picker data structrure
|
|
KV
: UserDefaults wraper class
Step2 Implement for some types
Int Picker
|
|
String Picker
|
|
Step3 Implement Picker View
|
|
Usage
|
|