Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Way to easily show all SF Symbols icon in apps

I am working on an app that shows all the features available in SwiftUI. As part of it, I wanted to display all the SF Symbols that are available. I was wondering if there was a way to do it easily (without needing to type up all the names/variations).

Thanks

like image 568
Thomas Braun Avatar asked Aug 07 '20 22:08

Thomas Braun


2 Answers

You can copy them from SF Symbols app (cmd+A to select all, and cmd+shift+c to copy all the names, paste to a text file, and refactor the names to Image(systemName: "NAME") easily.

like image 173
AlbertUI Avatar answered Oct 21 '22 23:10

AlbertUI


Here is how it's possible. No warranty of any kind for this code on passing the App Store review process.

if let bundle = Bundle(identifier: "com.apple.CoreGlyphs"),
    let resourcePath = bundle.path(forResource: "symbol_search", ofType: "plist"),
    let plist = NSDictionary(contentsOfFile: resourcePath) {

    /// keys in plist are names of all available symbols

}
like image 44
Eugene Dudnyk Avatar answered Oct 22 '22 00:10

Eugene Dudnyk