Skip to content

reez/BitcoinUI

Repository files navigation

cover image

BitcoinUI

BitcoinUI is a native iOS implementation of Bitcoin Wallet UI Kit.

Both BitcoinUI and its reference Bitcoin Wallet UI Kit are Work In Progress.

What's Included
Basic Usage
Requirements
Installation

What's Included

The design system in BitcoinUI includes:

  • Colors
  • Button styles
  • Text styles
  • Icons

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

Basic Usage

Colors

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

Button Styles

Three button styles (with a number of optional parameters) are implemented in SwiftUI:

  • BitcoinFilled

  • BitcoinOutlined

  • BitcoinPlain

SwiftUI

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

Text Styles

Ten text styles are implemented in SwiftUI:

  • BitcoinTitle1 - BitcoinTitle5

  • BitcoinBody1 - BitcoinBody5

SwiftUI

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

Icons

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)

Requirements

BitcoinUI currently requires minimum deployment targets of iOS 15.

Installation

You can add BitcoinUI to an Xcode project by adding it as a package dependency.

  1. From the File menu, select Add Packages…
  2. Enter "https://github.com/reez/BitcoinUI" into the package repository URL text field
  3. Depending on how your project is structured:
    • If you have a single application target that needs access to the library, then add BitcoinUI directly to your application.
    • If you want to use this library from multiple targets you must create a shared framework that depends on BitcoinUI and then depend on that framework in all of your targets.