After updating xCode i am getting this error into my code :
The compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions
The code :
//check popup in window frame
let spaceFromLeftSide = cutOutViewX.constant + cutOutViewWidth.constant/2 - (options.textWidth + padding*2)/2
if spaceFromLeftSide < 0{
if options.side == .bottom {
messageRightSpaceFromBottomDot.constant -= spaceFromLeftSide - padding
}
else if options.side == .top{
messageRightSpaceFromTopDot.constant += spaceFromLeftSide - padding
}
}
let spaceFromRightSide = cutOutViewX.constant + cutOutViewWidth.constant/2 + (options.textWidth + padding*2)/2
if spaceFromRightSide > targetView.frame.size.width{
if options.side == .bottom {
messageRightSpaceFromBottomDot.constant -= spaceFromRightSide - ( targetView.frame.size.width )
}
else if options.side == .top{
messageRightSpaceFromTopDot.constant += spaceFromRightSide - ( targetView.frame.size.width )
}
}
Error in line :
let spaceFromRightSide = cutOutViewX.constant + cutOutViewWidth.constant/2 + (options.textWidth + padding*2)/2
how to fix this ?