"the compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions" ...... it killing me !!!!
the compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions
Welcome to the forum.
Yes, it is probably one of the most frustrating error message of SwiftUI, with no indication at all where the problem is coming from.
And there may be may causes.
The only solutions I've found are:
- if you have a recent version that did work, compare the offending View with the previous one and detect what has changed
- Go by dichotomy:
-
- comment out a significant part (about half) of the body code
-
- if still fails, then error is in the other part ; so comment out half of this other part
-
- if is works, then I uncomment half of the commented and test again…
That's the best I've found.
- Post the complete code of the View on the forum so that one can search