はじめに
私はSwiftUIに慣れるまでこのエラーを出しまくりました。
しかし、よくエラーの意味がわかりませんでした笑
最近になって解決方法がわかったので記録しておきます。
エラー文
The compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions
「コンパイラは、この式を合理的な時間で型チェックすることができません。この式を個別の部分式に分割してみてください。」ということらしいです
原因
「Viewの中にエラーがあるがコードが多すぎでどこがエラーかわからない」
おそらくこんな感じではないかと思っています。
解決方法
Viewの中の要素を一つずつコメントアウトして原因箇所を探す
コードが少なくなるときちんとエラーが表示されるようになります。
おわり
おそらく、このエラーが出る方はクソでかViewを作っちゃっているので、
Viewは小さく分割して作るのがいいと思います。