UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

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 Essential Developer

SPONSORED Join a FREE crash course for mid/senior iOS devs who want to achieve an expert level of technical and practical skills – it’s the fast track to being a complete senior developer! Hurry up because it'll be available only until April 28th.

Click to save your free 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.