|
I was working through Project 15 and when I was doing the challenges of adding accessibility to old projects I kept getting an error if I passed anything other than a string literal to accessibilityLabel. The error is "The compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions." So if I had:
It worked fine. But if I had:
I'd get an error. This is from iExpense and item is an ExpenseItem and the name property is a string. |
|
Here's ContentView:
Here's the ExpenseItem struct:
|
|
I also tried cleaning the build folder, closing/reopening the project, closing/reopening xcode and rebooting. |
|
Try to refactor the EG
then in
|
|
Since And a separate note: You should really filter your expenses before you loop through them rather than having an |
|
@roosterboy Re: filtering, I remember I tried that but there was a problem that made it difficult to implement. I asked here about it and the best solution anyone had was using the if statements. I can't say it's elegant, I was inclined to try something like we have in C#/.NET, items.where(x => x.type == "Business"), but I couldn't find a syntactical equivalent. |
SPONSORED Transform your career with the iOS Lead Essentials. Unlock over 40 hours of expert training, mentorship, and community support to secure your place among the best devs. Click for early access to this limited offer and a FREE crash course.
Sponsor Hacking with Swift and reach the world's largest Swift community!
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.
Link copied to your pasteboard.