February, 2023

In Part 1 of this guide, we built the basics of a bitcoin wallet in SwiftUI. Now it’s time to give it some more style by using the Bitcoin UIKit, which has a swift package.

The Bitcoin UI Kit is developed by the Bitcoin Design community, and is used extensively in the Bitcoin Design Guide. It contains colors, text styles, button styles and more to get you started.

What we need to do

  1. Start with the code from Part 1
  2. Add the Bitcoin UI Kit Swift package
  3. Style our CreateWalletView
  4. Style our WalletView

This guide assumes some knowledge of developing for iOS with SwiftUI but should be fairly easy to follow. At the time of writing the current version of Xcode is 14, and bitcoinUIkit for Swift is at 0.2.1. Want to skip ahead? The complete code for this guide is available on Github.

1. Start with the code from Part 1

For this tutorial, we’ll assume that you have either followed along with Part 1, or have forked the code on Github.

  1. File > Open > Select the .xcodeproj file from the code directory

Untitled

If you run the app, you’ll see the very barebones UI that we were left with from Part 1, including some transactions in our history.

If you are running the app for the first time, you will instead see the CreateWalletView, equally unstyled.

You can also see the CreateWalletView by commenting out the code in the app init() function that checks for an existing wallet.

Untitled