TEAM LICENSES: Save money and learn new skills through a Hacking with Swift+ team license >>

Day 19 challenge

Forums > 100 Days of SwiftUI

This code:

Section { Text("((Double(self.conversion[self.startUnits[self.startUnit]] ?? 1) / (self.conversion[self.targetUnits[self.targetUnit]] ?? 1) * self.startAmount), specifier: "%.2f")")

triggers this error message: "The compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions".

How does one do this? Apparently cannot declare variables within the body view and cannot do it before then either because user input is needed.

3      

Tim,

No, I have not looked at those because I did not know they existed which raises a new question: How does one search for such posts? When I type in key words on this page's search field, such as "Day 19", I get a barrage of links to random articles. When I browse the topic lines of the "100 Days of SwiftUI", the one you referenced does not appear. Further, I would have never thought to browse the SwiftUI forum, but now I at least know that much.

Thank you!

Chris

3      

Hi Chris,

Yes Paul's site is a great resource, however you can't beat the king of search so I always head to google, I searched for:

"Day 19 challenge swiftui forums"

I do the same for other sites like stackoverflow or even apple.

Regards, Tim.

3      

Hacking with Swift is sponsored by Blaze.

SPONSORED Still waiting on your CI build? Speed it up ~3x with Blaze - change one line, pay less, keep your existing GitHub workflows. First 25 HWS readers to use code HACKING at checkout get 50% off the first year. Try it now for free!

Reserve your spot now

Sponsor Hacking with Swift and reach the world's largest Swift community!

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.