SettingsIconGenerator

使用 Apple 的 SF Symbols 生成设置图标。

iOS 开发者社区

导航

安装

可以在 iOS 13+ 及更高版本上使用。

Swift 包管理器

在 Xcode 中,前往 Project -> 你的项目名称 -> Package Dependencies -> 点击 Plus 按钮。插入 URL

https://github.com/sparrowcode/SettingsIconGenerator

或者将其添加到你的 Package.swift 文件的 dependencies

dependencies: [
    .package(url: "https://github.com/sparrowcode/SettingsIconGenerator", .upToNextMajor(from: "1.0.0"))
]

CocoaPods

这是一种过时的方法。我建议你使用 SPM。但是,我会在一段时间内继续支持 Cocoapods。

Cocoapods 安装

CocoaPods 是一个依赖管理器。有关使用和安装说明,请访问他们的网站。要使用 CocoaPods 进行集成,请在你的 Podfile 中指定它

pod 'SettingsIconGenerator'

手动

如果你不想使用任何依赖管理器,你可以手动集成。将 Sources/SettingsIconGenerator 文件夹放入你的 Xcode 项目中。确保启用 Copy items if neededCreate groups

用法

UIKit

let image = UIImage.generateSettingsIcon("bell.fill", backgroundColor: .systemBlue)

SwiftUI

SettingsIcon("bell.fill", backgroundColor: .systemBlue)

或者如果需要生成图像

Image.generateSettingsIcon("bell.fill", backgroundColor: .systemBlue)

使用的应用

如果你使用了 SettingsIconGenerator,请通过 Pull Request 添加你的应用。