I recently upgraded my project to Swift 3 and have been having some trouble with a string interpolation error.
My code:
let coordString = "\(locationCoordinate.latitude) \(locationCoordinate.longitude)".stringByReplacingOccurrencesOfString(".", withString: ",")
The error says:
Static member 'init(stringInterpolationSegment:)' cannot be used on instance of type 'String'
How can I solve the error?
(NS)Numberformatterto display the decimal separator of a number according to the current locale. FurtherstringByReplacingOccurrencesOfStringhas been renamed in Swift 3.