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

Popular posts from this blog

Combining PHP Registration and Login into one class with multiple functions in one PHP file -

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -