Yalantis / PullToMakeSoup

Custom animated pull-to-refresh that can be easily added to UIScrollView
https://yalantis.com/
MIT License
1.92k stars 213 forks source link

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

Closed alexliubj closed 8 years ago

alexliubj commented 8 years ago

Pulltomakesoup.swift file and location has this error:

let progressWithOffset: (Double, Double) -> Double = { offset, progress in return progress < offset ? 0 : Double((progress - offset) * 1 / (1 - offset))

alexliubj commented 8 years ago

Resolving this with replacing it by a function

func progressWithOffset(offset:Double, progress: Double) -> Double { return progress < offset ? 0 : Double((progress - offset) * 1 / (1 - offset)) }

sekouperry commented 8 years ago

Thanks for the fix.

jiaowochunge commented 8 years ago

seems like hasn't applied yet. the solution above has a little problem.the second parameter should be omitted.just add '_'

func progressWithOffset(offset:Double, _ progress: Double) -> Double { return progress < offset ? 0 : Double((progress - offset) * 1 / (1 - offset)) }

Art3mS1d commented 8 years ago

Thanks, @alexliubj and @jiaowochunge . Now fix in the master. Pod also updated