Swift Fluent 图标

Build Release Test Format

警告

swift-fluent-icon 目前正在开发中

重要提示

深受 Font AwesomeLiveUI/Awesome 的启发

一个很棒的 Swift 库,用于将 fluent icon 打包到你的应用中,无需任何成本,无需删除未使用的资源,像 SF Symbol 一样使用,但类型安全,与 fluent icon 团队提供的原始方法相比,几乎没有构建时间增加

安装

你可以将 FluentIcon 添加到 Xcode 项目中,通过将其作为包添加到你的项目中。

https://github.com/vvisionnn/swift-fluent-icon

如果你想在 SwiftPM 项目中使用 FluentIcon,只需将其添加到你的 Package.swift 文件中即可

dependencies: [
  .package(url: "https://github.com/vvisionnn/swift-fluent-icon", from: "<any-version-released>")
]

然后将产品添加到任何需要访问库的目标中

.product(name: "FluentIcon", package: "swift-fluent-icon"),

快速开始

// SwiftUI usage
FluentIcon.Filled.sparkle48.image
  .size(<size-you-want>)

// UIKit/AppKit Usage
UIImageView(image: FluentIcon.Filled.sparkle48.asImage())
NSImageView(image: FluentIcon.Filled.sparkle48.asImage())

更多示例

请查看 Example 文件夹或克隆然后打开 FluentIcon.xcworkspace

替代方案

在 Swift 社区中有很多其他图标库。这里有一些知名的例子

许可证

此库在 MIT 许可证下发布。详情请参阅 LICENSE