SwiftOCR
SwiftOCR copied to clipboard
Not compatible with Xcode 12 beta5
error: the compiler is unable to type-check this expression. solution: explicitly declare the type of Modi { (modi: CGFloat) in ... }
![WX20200824-161248@2x](https://user-images.githubusercontent.com/16110563/91020893-9ec35000-e625-11ea-91ab-e9c65c0bfb3b.png)
@leiguang Do you found the solution ? i have this problem too
same
My work around:
I moved randomFloat
-constant outside of the generateRealisticCharSet
-func (and removed the duplicate in generateCharSetFromImages
), updated the randomFloat
to self.randomFloat
.
simply split the expression to multiple parts:
let randomFloat: (CGFloat) -> CGFloat = { modi in
let temp = (0 - modi) + CGFloat(arc4random())
let temp2 = CGFloat(UINT32_MAX) * (modi * 2)
return temp / temp2
}