swift - attributed text not working with custom font in xcode 7 -


i using xcode 7. when using attributed text custom font displays in storyboard not working on device. tried following code:

var mymutablestring = nsmutableattributedstring()      let paragraphstyle = nsmutableparagraphstyle()     paragraphstyle.linespacing = 8     paragraphstyle.alignment = nstextalignment.center      mymutablestring = nsmutableattributedstring(string: "\"taking out shorts , t-shirt night before has helped create great morning routine walk\"", attributes: [nsfontattributename:uifont(name: "gotham medium", size: 20.0)!])     mymutablestring.addattribute(nsparagraphstyleattributename, value:paragraphstyle, range:nsmakerange(0, mymutablestring.length))      quoteslabel.attributedtext = mymutablestring 

make sure app contains font file gotham medium. check out great article common mistakes adding custom fonts in ios apps.

  1. include fonts in xcode project
  2. make sure they’re included in target
  3. double check fonts included resources in bundle
  4. include ios custom fonts in application plist
  5. find name of font
  6. use uifont , specify name of font

Comments

Popular posts from this blog

html - Firefox flex bug applied to buttons? -

html - Missing border-right in select on Firefox -

python - build a suggestions list using fuzzywuzzy -