bennyguitar / Colours

A beautiful set of predefined colors and a set of color methods to make your iOS/OSX development life easier.
MIT License
3.1k stars 301 forks source link

Expression was too complex to be solved in reasonable time; consider breaking up the expression into distinct sub-expressions #35

Open ghost opened 9 years ago

ghost commented 9 years ago

When trying to build my project using the Colours pod ( Swift version ) I'm facin the following error.

Expression was too complex to be solved in reasonable time; consider breaking up the expression into distinct sub-expressions

Like the message stated this is easily fixed by removing the one-liner and separating it over several lines.

        var deltaF: TransformBlock = { f in
            if  f > pow((6.0/29.0), 3.0) {
                return pow(f, 1.0/3.0)
            } else {
                return (1/3)*pow((29.0/6.0), 2.0) * f + 4/29.0
            }
            //return (f > pow((6.0/29.0), 3.0)) ? pow(f, 1.0/3.0) : (1/3)*pow((29.0/6.0), 2.0) * f + 4/29.0
        }
}

Colours.Swift line 148

http://puu.sh/hgVYY/4b02d52c59.png

franklsf95 commented 9 years ago

Same here.

ghost commented 9 years ago

Same problem here. This occurred after adding Objective-C bridging header file for another project.

ghost commented 9 years ago

Even with correction as presented on the first comment Xcode complain.