【发布时间】:2021-10-30 19:49:34
【问题描述】:
我正在使用 SwiftUI,我有一个开关盒功能,取决于我想显示差异颜色和文本的开关盒。
func status(status: Status){
switch status {
case .accepted:
//text "accepted"
//green text
case .standby:
//text "standby"
//yellow text
case .notAllowed:
//text "notAllowed"
//red text
}
}
VStack(alignment: .leading) {
Text("Test")
}
【问题讨论】:
标签: ios swift swiftui switch-statement