Skip to main content
This article describes two different ways to customize your iOS application using the iOS SDK:
  • Static Resources customize the UI layout during build time.
  • Programmatic Customization modifies the layout at run time.
Note:You can combine static and programmatic approaches for customization.
To use the SDK in the most flexible way, combine the reference in this article with the iOS SDK. Sample Application: Refer to the iOS sample application for example code.

Layouts

How to Use the Layout Images and Index Tables

This section includes screenshots of layouts for the SDK functionality. As you review the layouts, you can cross-reference the alphanumeric tags in the images with the values in the index tables that follow this section:

New PIN Code

Confirm PIN Code

Enter PIN Code

Security Intro

Security Questions

Select Question

Security Summary

Security Confirm

Recover PIN Code

Biometrics Setup

Touch ID Setup

Confirm Transaction

Contract Interaction

Signature Request

Verify Email OTP

Index Table A

Based on the layouts, table A provides the UI item named in the controller and the keys in use. You can get the UIViewController from WalletSdkDelegate and customize the UI items in the run time. Also, you can provide the values in static resources CirclePWLocalizable.strings and CirclePWTheme.json for customization layouts in build time.

Index Table B

By confirming the WalletSdkLayoutProvider, you can custom layout from Table-B dynamically. See the Sample Code.

Index Table C

  • Use the ImageStore.Img (Enum) column to customize with the WalletSdkLayoutProvider:
Swift
  • If you set both local and remote images, the remote image will present after the image loads, and the local image will be set as the placeholder image.
  • The remote image formats supported include those from the Apple system (JPEG, PNG, TIFF, BMP, etc.), GIF, and APNG animated images.
  • The remote image formats unsupported for new image formats include HEIC, BPG, AVIF, and vector formats such as PDF and SVG.
  • The Controller and Item column shows where the images are used.
    Refer to the UI items If you have special customizations with WalletSdkDelegate (not recommended)

Static Resources

This section describes how to customize the UI for iOS statically.
Note:Circle recommends customizing the UI using static files.You can copy the icon images from the Sample Project.

Assets

Because the CircleProgrammableWalletSDK does not contain any image resources for the SDK; you must provide the icon images from either local assets or remote URLs.
Important:Setting the WalletSdkLayoutProvider.imageStore in WalletSdkLayoutProvider is required for you to see icons in the layouts.

CirclePWLocalizable.strings

Setup

  1. Create a file CirclePWLocalizable.strings in your main bundle.
  2. Provide your strings. Partial override is supported.
Note:You can provide specific keys and values you want to override and others keys will still refer to the default values.
  1. Localization is supported. For more information, see Localization | Apple Developer Documentation.

Example CirclePWLocalizable.strings

Swift

CirclePWTheme.json

Setup

  • Copy the file CirclePWTheme.json into your main bundle. You can use Cmd + drag and drop.
  • Make sure you have selected the Target Membership.

Example: CirclePWTheme.json

JSON

Programmatic Customization

To programmatically customize the UI refers to the following documents:

Example Code

Swift

WalletSdkDelegate

By modifying the WalletSdkDelegate, you can get the current view controller and control the UI parameters in the controller at run time.
Swift

Example Code

Swift

View Public Interface

Use Jump to Definition (Cmd + left click) to see the public interface of the view controller. Change the UI items as you need.

Jump to Definition

Public Interface

ErrorMessenger

 ApiError Interface

Swift
By modifying the ErrorMessenger, you can customize the ApiError messages. Your customization replaces the default ApiError.displayString for UI usage. You can also manage the localized error message.
Swift

Example Code

Swift

ErrorCode and Messages Table

The following table shows the ApiError.ErrorCode key names and their default values: