suzuki-0000 / CountdownLabel

Simple countdown UILabel with morphing animation, and some useful function.
MIT License
999 stars 192 forks source link

Fix expression to remove type-check compiler error in Xcode 12.5 #58

Open hungHatto opened 3 years ago

hungHatto commented 3 years ago

Issue

This issue is getting after Xcode 12.5 update

The issue is caused by the expression which needed to be break down into sub-expressions

Using release version : 4.0.1

The compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions

sub-expressions_xcode12-5

Proposed solution

Replacing expression:

  return {
        return c * ($0 * $0 * $0 * $0 * $0 + 1.0) + b
  }(t / d - 1.0)

with

   return { (f: Float) in
            return c * (pow(f, 5) + 1.0) + b
    }(t / d - 1.0)
Elamuruga commented 3 years ago

@hungHatto just to fix this temporarily, you can use commit in your podfile. Here is how to add the commit in your Pod file

pod 'CountdownLabel', :git => 'https://github.com/linkstreet/CountdownLabel.git'