iossvgiconsuifont

How to display icon using font ? ios


I got a file(please find attached file) which contain font, this font supposed to display icons according to code number. but i didn't succeed to display any icon with this font. here is my code:

    iconTest = UILabel();
    iconTest.frame = CGRectMake(0, 0, 100, 100);
    onTest.center = self.view.center;

    iconTest.font = UIFont(name: "icomoon", size:16.0);
    iconTest.text = "e906";

what's the correct way to display icons using font !

download font svg file


Solution

  • You have to set text property like:

    iconTest.text = "\u{e906}";
    

    Do not forget to register your custom font in your app.