Skip to content

Instantly share code, notes, and snippets.

@zats
Last active February 17, 2024 10:23
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zats/ffd6b2c72b8753f043ec769c6c6739b5 to your computer and use it in GitHub Desktop.
Save zats/ffd6b2c72b8753f043ec769c6c6739b5 to your computer and use it in GitHub Desktop.
Internal SF Symbols

image

List of all the images in /Library/Developer/CoreSimulator/Volumes/iOS_21A328/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.0.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/SFSymbols.framework/CoreGlyphsPrivate.bundle/Assets.car

Extract using https://github.com/insidegui/AssetCatalogTinkerer etc

struct ContentView: View {
var body: some View {
let names = [
["appstore.app.dashed", "buildings.3d", "emoji.chicken.face"],
["person.text.rectangle.and.nfc", "secure.element", "laugh.bubble.tapback.2.he"],
["apple.news", "apple.podcasts.square.stack", "apple.slice"],
]
VStack(spacing: 20) {
Grid(horizontalSpacing: 20, verticalSpacing: 20) {
ForEach(names, id: \.self) { nameRow in
GridRow {
ForEach(nameRow, id: \.self) { name in
Image(privateSystemName: name)
.imageScale(.large)
.foregroundStyle(.tint)
.tint(Color(hue: .random(in: 0...1), saturation: 1, brightness: 0.7))
}
}
}
}
Text("Internal SF Symbols")
.font(.caption)
}
}
}
extension Image {
init(privateSystemName: String) {
self.init(uiImage: UIImage(privateSystemName: privateSystemName))
}
}
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface SFSCoreGlyphsBundle: NSObject
@property (nonatomic, class, readonly) NSBundle *private;
@end
@interface _UIAssetManager : NSObject
+ (instancetype)assetManagerForBundle:(NSBundle *)bundle;
- (UIImage *)imageNamed:(NSString *)name;
@end
@interface UIImage (SFSCoreGlyphsBundle)
- (instancetype)initWithPrivateSystemName:(NSString *)name;
@end
NS_ASSUME_NONNULL_END
#import "SFSymbols.h"
@implementation UIImage (SFCoreGlyphBundle)
- (instancetype)initWithPrivateSystemName:(NSString *)name {
NSBundle *const bundle = [NSClassFromString(@"SFSCoreGlyphsBundle") private];
_UIAssetManager *const assetManager = [_UIAssetManager assetManagerForBundle:bundle];
self = [[assetManager imageNamed:name] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
return self;
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment