I've created some Icon Fonts using websites like (http://fontastic.me/) which gives you .ttf file.
you can use it by
myLable.text = "\u{e002}" //
print("\u{e002}") //
print("\u{1F496}") //
this works nicely but I want to pass string directly using storyboard.
Then I start working with UILabel Subclass and create @IBInsectable for unicode string. but this was not working. following is code of IBInspectable.
@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 not working
print(myString)
text = String(UTF8String: myString!)
but this will print only text it's suppose to print Icon like print("\u{e002}")
this.
how to solve this, what I'm missing ?
thanks in advance for any help.