Swiftpack.co - Package - atmcoin/cash-ui-ios

cash-ui-ios

This is the UI framework for the Cash project. This framework allows the redemption process as well as newly implemented features to be independent of any wallet integrations.

It is an approach to solve issues like:

  • UI and unit tests of our flows without any other project dependency.
  • Removes the dependency from any wallet.
    • the code can be ported to any wallet without changing the UI and with the simplicity of jsut adding a few lines of code to make it work
    • avoids conflcts. If it was integrated with a parent project (currently to bread wallet).

Usage

Right now the code that any wallet needs to implement is:

Setup the packages:

CoreSessionManager.shared.start()
CoreSessionManager.shared.delegate = self

To show the menu view (this view is the triggering point for all the flow)

let vc = CashUI.MenuViewController()
navigationController.pushViewController(vc, animated: true)

Implementation of the SessionManagerDelegate is mandatory, as the framework needs the wallet's implementation to send coin.

extension AppDelegate: CoreSessionManagerDelegate {
    
    func sendCoin(amount: String, address: String, completion: @escaping (() -> Void)) {
        let applicationController = self.applicationController
        let modalPresenter = applicationController.modalPresenter
        
        let currencyId = Currencies.btc.uid
        modalPresenter!.presentModal(for: currencyId, amount: amount, address: address, completion: {
            completion()
        })
    }
}

Any other views can also be shown like

func presentActivity() {
    let vc = ActivityViewController()
    self.topViewController?.present(vc, animated: true, completion: nil)
}

The current version of the package does not allow Resources as the version of Swift used does not allow it. Once we move to Swift 5.3 all of the resources used but the package can be included within it. The list of Resources that need to be included in the wallet's UI are:

XIB's

SendVerificationView.xib
ActivityView.xib
AtmLocationsView.xib
VerifyCashCode.xib
WithdrawalStatusView.xib
ListView.xib
ActivityTableViewCell.xib
MenuView.xib
AtmInfoView.xib

Images - As part of a .xcassets file

atmGrey
atmWhite
Close
Help

Other Resources (like Strings) may also need to be included

Github

link
Stars: 0

Dependencies

Used By

Total: 0

Releases

1.0.2 - Convert map styling to support light only - 2020-09-02 15:27:21

  • Remove condition to set maps to dark on iOS version greater or equal to 13. All maps will be light for now

1.0.1 - 2020-09-01 18:30:28

  • Change string value of Transaction Status Cancelled enum

1.0.0 - 2020-08-31 18:21:33

Swift Package Manager

This release removes the Just Cash implementation for Redeeming (Cash Out) from the BRD wallet and creates a package that conforms to SPM.

  • Implements the Package manifest
  • Copies all of the files needed for the Redeem flow from BRD Wallet over.
  • Sets minimum iOS version to iOS 11
  • Uses swift tools version 5.2 but includes resources needed when converting to 5.3
  • Updates Readme file with a sample of how to implement the package on wallets
  • Adds Cash SDK as a dependency as specified in the manifest
  • Refactors validation to be an extension of String
  • Migrates transactions so the user can keep the history from previous releases of the app
  • Renames some files to a more generic approach
  • Adds internal documentation of signatures