Hi all,
I am new to SwiftUI. Need help.
I have 2 text fields, based on the amount entered on field1, percentage calculation shold happen and populated in textField2.
.onChange(of: pnlText) { newValue in
let formatted = formatInput(newValue)
pnlText = formatted
if let pnlValue = Double(formatted) {
pnl = pnlValue
if open_bal != 0 {
pnl_pcntText = pnlValue / open_bal
} else {
pnl_pcntText = 0.0
}
} else {
pnl = 0.0
pnl_pcntText = 0.0
}
}
I am getting below error.
"The compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions".
What is other way to do this. Please help.
Thank you.