SwiftOCR icon indicating copy to clipboard operation
SwiftOCR copied to clipboard

Not compatible with Xcode 12 beta5

Open leiguang opened this issue 3 years ago • 4 comments

error: the compiler is unable to type-check this expression. solution: explicitly declare the type of Modi { (modi: CGFloat) in ... }

WX20200824-161248@2x

leiguang avatar Aug 24 '20 08:08 leiguang

@leiguang Do you found the solution ? i have this problem too

diakobits avatar Sep 27 '20 13:09 diakobits

same

alex955 avatar Oct 15 '20 09:10 alex955

My work around: I moved randomFloat-constant outside of the generateRealisticCharSet-func (and removed the duplicate in generateCharSetFromImages), updated the randomFloat to self.randomFloat.

radeonxray avatar Oct 27 '20 10:10 radeonxray

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
}

maticla avatar Jan 06 '21 16:01 maticla