ios - SF-Symbols 位于哪里?

标签 ios swift swiftui sf-symbols

成为 bundle 中使用的 SF-Symbols 的一部分并编译为可执行文件?还是只有引用,实际图标由用户的操作系统提供?

最佳答案

符号存储在操作系统中的某个位置。您的应用仅包含对它们的“引用”。

根据this post ,iPhone模拟器中的SF符号位于:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/
Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/
Resources/RuntimeRoot/System/Library/PrivateFrameworks/SFSymbols.framework/
CoreGlyphs.bundle/Assets.car

请注意,这是在“iOS.simruntime”内部,这是存储模拟 iOS 操作系统的地方。我想在真正的 iOS 设备上,它将位于“RuntimeRoot”之后的路径:

/System/Library/PrivateFrameworks/SFSymbols.framework/CoreGlyphs.bundle/Assets.car

Peeking into this Assets.car file ,我们可以看到它有这样的条目:

  {
    "AssetType" : "Image",
    "BitsPerComponent" : 8,
    "ColorModel" : "Monochrome",
    "Colorspace" : "gray gamma 22",
    "Compression" : "deepmap2",
    "DeploymentTarget" : "2019",
    "Encoding" : "Gray",
    "Glyph Size" : "Medium",
    "Glyph Weight" : "Regular",
    "Idiom" : "universal",
    "Name" : "square.lefthalf.filled",
    "NameIdentifier" : 54903,
    "Opaque" : false,
    "PixelHeight" : 27,
    "PixelWidth" : 27,
    "RenditionName" : "square.lefthalf.filled.svg",
    "Scale" : 2,
    "SHA1Digest" : "2299C5EE9722FDB79BC6BA4458980605076D4356BA01FC2107228DC99D53E42A",
    "SizeOnDisk" : 338,
    "State" : "Normal"
  },

请注意,“名称”属性都是 SF 符号名称。

关于ios - SF-Symbols 位于哪里?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/76684913/

相关文章:

ios - 注销后如何重新加载 Root View Controller ?

ios - 如何通过快速添加 View 来重叠导航栏?

swift - 在 swift 中将映射应用到 JSON 数组

ios - "Binary operator ' < ' cannot be applied to two CFIndex operands"- 从 ABMultiValue(地址簿)中选择一个电话号码

ios - 如何获取 iOS 用户代理字符串

ios - GoogleConversionPing undefined symbol

SwiftUI:在创建 View 后动态更改 View 的过渡

android - 如何在React Native Expo中的Dropdown选项中动态获取api数据

ios - SwiftUI Landmarks App 教程屏幕在切换收藏夹时导航返回

ios - swift 用户界面 : Update view with random element from array