问题
I created xAxis to show my characters in the center of the screen because I'm creating Puzzle Word project, now my issue is my characters showing from left, how to convert from left to right ?? because my characters are Arabic.
For example my word is (London) but show me inversion (nodnoL) This example is in English. So how to fix this issue convert to right side or left side ??
This my code :
for (indexTar, tar) in data.ans.characters.enumerated() {
let x : CGFloat = (width / 2) - (totalWidth / 2)
let xx : CGFloat = (CGFloat(indexTar) * targetWidth) + (CGFloat(indexTar) * 5) + 20
var xAxis : CGFloat = (x + xx)
let targetLabel = UILabel(frame: CGRect(x: xAxis, y: yAxis, width: targetWidth, height: 5.0))
.....
}
来源:https://stackoverflow.com/questions/45242109/swift-3-convert-characters-side-from-right-to-left-or-left-to-right