"UIAppFonts"
"Fonts provided by application"
Bundle.main.infoDictionary["UIAppFonts"]
例:
if let fonts = Bundle.main.infoDictionary["UIAppFonts"] as? [String] { // List all of the fonts for font in fonts { print(font) } // Get the first font let font = fonts[0] // or more safely if let font = fonts.first { } }
Info.Plist是一本字典。因此,要访问您可以使用的字体数组
Bundle.main.infoDictionary["Fonts provided by application"]
但是要访问您需要使用的每个元素
(Bundle.main.infoDictionary["Fonts provided by application"] as? Array)?.startIndex