I read this thread but it seems have another problem. This code:
if value.range(of: String(formatter.minusSign))?.count > 0 {
//STH
}
(where formatter
is NumberFormatter
object and value
is String
) produce this error in Swift:
Type 'String.Index' does not conform to protocol '_Strideable'
How to solve it?