i have some text and i want to add this text to UILabel in style like this: (x+y)³ but instead ³ some text. How can i do this in swift, help me please?
Asked
Active
Viewed 54 times
1 Answers
1
That what you are looking for is a Mutable Attributed String. Here is a nice answer on Stackoverflow: Attributed Strings in Swift
Alternatively, you can subclass UILabel, and draw the text yourself in drawRect. If you do it this way, just add an instance variable to tell you how much of the string to draw in one format, and draw the rest in another.
Or as a obvious solution: you create another UILabel at the end of the first UILabel.