Sara Canducci Sara Canducci - 1 year ago 109
Swift Question

Convert code from Objective-C to Swift

I've got this line of code in Objective-C and I absolutely need to "translate it" to Swift.

BOOL hasBlur = blurRadius > __FLT_EPSILON__

Unfortunately I get this error:

Use of unresolved identifier __FLT_EPSILON_

Can you help me?

Answer Source

__FLT_EPSILON__ is a predefined macro of the compiler, apparently not available in Swift. But <float.h> defines


and this is available in Swift as well:

let hasBlur = blurRadius > FLT_EPSILON
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download