I created some icons using websites like ( http://fontastic.me/ ) which gives you a .ttf file.
you can use it
myLable.text = "\u{e002}"
print("\u{e002}")
print("\u{1F496}")
this works well, but I want to pass the line directly using the storyboard.
Then I start working with a subclass of UILabel and create @IBInsectable for the unicode string. but it didnโt work. following IBInspectable code.
@IBInspectable internal var myString: String? {
didSet {
text = "\u{e002}" //๎ this works
text = "\\u{\(myString)}" //\u{e002} this not
}
or
let myString = "e002"
print("\\u{\(myString)}") //\u{e002}
even this also doesn't work
print(myString)
text = String(UTF8String: myString!)
but it will only print text that would suggest printing an icon, for example print("\u{e002}"). How to decide what I am missing?
in advance for help.
source
share