How to convert character index from layoutManager to String scale in swift? this is the code I'm using:
let touchPoint: CGPoint = gesture.locationOfTouch(0, inView: self.definitionLabel)
let index = layoutManager.characterIndexForPoint(touchPoint, inTextContainer: textContainer, fractionOfDistanceBetweenInsertionPoints: nil)
please don't tell me to use advanceBy()
function on the first index of the string characterset since characters like ò count two in the scale of layoutManager but swift string counts theme once.