룰렛 설정
- 확률 총합 추가
This commit is contained in:
@@ -13,6 +13,7 @@ struct RouletteSettingsOptionView: View {
|
||||
|
||||
let index: Int
|
||||
let onClickDelete: () -> Void
|
||||
let calculateTotalPercentage: () -> Void
|
||||
|
||||
var body: some View {
|
||||
VStack(spacing: 6.7) {
|
||||
@@ -55,6 +56,8 @@ struct RouletteSettingsOptionView: View {
|
||||
if newValue.count > 5 {
|
||||
option.percentage = String(newValue.prefix(5))
|
||||
}
|
||||
|
||||
calculateTotalPercentage()
|
||||
}
|
||||
|
||||
Text("%")
|
||||
@@ -76,7 +79,8 @@ struct RouletteSettingsOptionView_Previews: PreviewProvider {
|
||||
RouletteSettingsOptionView(
|
||||
option: RouletteOption(title: "옵션1", percentage: ""),
|
||||
index: 2,
|
||||
onClickDelete: {}
|
||||
onClickDelete: {},
|
||||
calculateTotalPercentage: {}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user