cover image

BitcoinUI

BitcoinUI 是 Bitcoin Wallet UI Kit 的原生 iOS 实现。

BitcoinUI 及其参考 Bitcoin Wallet UI Kit 都还在开发中。

包含内容
基本用法
需求
安装

包含内容

BitcoinUI 中的设计系统包括

colors-code-preview buttons-code-preview text-code-preview hardware-illustrations-code-preview address-code-preview words-code-preview

基本用法

颜色

SwiftUI

Text("Bitcoin Orange")
    .font(.caption)
    .foregroundColor(.bitcoinOrange)
    .multilineTextAlignment(.center)

UIKit

let label = UILabel()
label.frame = CGRect(x: 200, y: 200, width: 200, height: 20)
label.text = "Bitcoin Orange"
label.textColor = .bitcoinOrange

按钮样式

SwiftUI 中实现了三种按钮样式(带有许多可选参数)

SwiftUI

Button("Filled button") {
    print("Button pressed!")
}
.buttonStyle(BitcoinFilled())

文本样式

SwiftUI 中实现了十种文本样式

SwiftUI

Text("Title")
    .textStyle(BitcoinTitle1())

图标

SwiftUI

BitcoinImage(named: "coldcard")
    .resizable()
    .aspectRatio(contentMode: .fit)
    .frame(height: 75.0)

UIKit

let image = BitcoinUIImage(named: "coldcard")
let imageView = UIImageView(image: image)
imageView.frame = CGRect(x: 0, y: 0, width: 75, height: 75)
view.addSubview(imageView)

需求

BitcoinUI 当前需要 iOS 15 的最低部署目标。

安装

您可以通过将其作为包依赖项添加到 Xcode 项目中来添加 BitcoinUI。

  1. File(文件)菜单中,选择Add Packages…(添加包…)
  2. 将“https://github.com/reez/BitcoinUI”输入到包存储库 URL 文本字段中
  3. 具体取决于项目的结构
    • 如果只有一个应用程序目标需要访问该库,请将 BitcoinUI 直接添加到您的应用程序。
    • 如果想要从多个目标使用此库,则必须创建一个依赖于 BitcoinUI 的共享框架,然后在所有目标中依赖于该框架。