Ios Swift Looping through Fonts provided by application in info.plist -
using xcode 7 , swift 2
i have assigned string each font in info.plist -> fonts provided application -> array
how loop through these fonts , assign in loop
i tried : output nil
var familylist = nsbundle.mainbundle().objectforinfodictionarykey("fonts provided application") [string]
i came across below code gives me list of family names, dont need.
i need same loop fonts have added.
for family: anyobject in uifont.familynames() { println("font family: \(family)") font: anyobject in uifont.fontnamesforfamilyname(family nsstring) { println("font name: \(font)") } }
to retrieve info in info.plist, can use objectforinfodictionarykey()
uiappfonts
key.
i don't speak swift, , don't know if code compile, should able idea.
let fonts = nsbundle.mainbundle.objectforinfodictionarykey(uiappfonts) nsarray
that should give array of fonts. it's construct uifont
objects.
Comments
Post a Comment