I have a string like this
var str = "@text1 this is good @text1"
Now replace text1
with another string, say t 1
. I am able to replace the text, but i am not able to bold it. I want to bold the new string t 1
, so that the final output will be:
@t 1 this is good @t 1
How can I do it?
All the examples I am seeing are in Objective-C, but I want to do it in Swift.
Thanks in advance.
Just use code something like this:
edit/update: Xcode 8.3.2 • Swift 3.1
If you know HTML and CSS you can use it to easily control the font style, color and size of your attributed string as follow: