コンパイラは、妥当な時間内にこの式を型チェックすることができません。式を個別のサブ式に分割してみてください
//ウィンドウフレームのポップアップを確認します
let spaceFromLeftSide = cutOutViewX.constant + cutOutViewWidth.constant/2 - (options.textWidth + padding*2)/2
let spaceFromRightSide = cutOutViewX.constant + cutOutViewWidth.constant/2 + (options.textWidth + padding*2)/2
問題は、式が複雑なため、コンパイラが時間内に値を計算できないことです。これらの式を次のようなサブ式に分割する必要があります。
let cutOutValue = cutOutViewX.constant + cutOutViewWidth.constant/2
let optionsValue = (options.textWidth + padding*2)/2
let spaceFromLeftSide = cutOutValue - optionsValue
let spaceFromRightSide = cutOutValue + optionsValue
このタイプのブレークは、コンパイル時に役立つだけでなく、変数の現在の値を確認できるデバッグ時にも役立ちます。
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加