From 7d954f39b29e3e89f9311f20297374f08b71899f Mon Sep 17 00:00:00 2001 From: Leone Parise <1442927+leoneparise@users.noreply.github.com> Date: Thu, 25 Jun 2020 00:01:13 -0300 Subject: [PATCH] Pay with Trust Button (#51) * First draft of create with trust button implementation * Add icons and improve button theming * Finish button theming * Start action for button * Finish TrustButton implementation * Update colors for dark mode --- Example/Podfile.lock | 2 +- Example/TrustSDK.xcodeproj/project.pbxproj | 16 +-- .../TrustSDK/{Base.lproj => }/Main.storyboard | 86 ++++++------ Example/TrustSDK/ViewController.swift | 84 ++++++++---- TrustSDK.podspec | 3 + .../Classes/Client/Extensions/String.swift | 6 + TrustSDK/Classes/Client/UI/Colors.swift | 26 ++++ TrustSDK/Classes/Client/UI/Icons.swift | 36 +++++ TrustSDK/Classes/Client/UI/TrustButton.swift | 111 ++++++++++++++++ .../Classes/Client/UI/TrustButtonTheme.swift | 123 ++++++++++++++++++ TrustSDK/Classes/Client/UI/UIColor+Hex.swift | 21 +++ TrustSDK/{Assets => Resources}/.gitkeep | 0 .../Resources/Images.xcassets/Contents.json | 6 + .../trust.imageset/Contents.json | 16 +++ .../trust.imageset/trust_icon.pdf | Bin 0 -> 6348 bytes .../trust.shield.fill.imageset/Contents.json | 16 +++ .../trust_filled.pdf | Bin 0 -> 5915 bytes .../trust.shield.imageset/Contents.json | 16 +++ .../trust.shield.imageset/trust_line.pdf | Bin 0 -> 6260 bytes .../Resources/en.lproj/Localizable.strings | 3 + 20 files changed, 483 insertions(+), 88 deletions(-) rename Example/TrustSDK/{Base.lproj => }/Main.storyboard (56%) create mode 100644 TrustSDK/Classes/Client/UI/Colors.swift create mode 100644 TrustSDK/Classes/Client/UI/Icons.swift create mode 100644 TrustSDK/Classes/Client/UI/TrustButton.swift create mode 100644 TrustSDK/Classes/Client/UI/TrustButtonTheme.swift create mode 100644 TrustSDK/Classes/Client/UI/UIColor+Hex.swift rename TrustSDK/{Assets => Resources}/.gitkeep (100%) create mode 100644 TrustSDK/Resources/Images.xcassets/Contents.json create mode 100644 TrustSDK/Resources/Images.xcassets/trust.imageset/Contents.json create mode 100644 TrustSDK/Resources/Images.xcassets/trust.imageset/trust_icon.pdf create mode 100644 TrustSDK/Resources/Images.xcassets/trust.shield.fill.imageset/Contents.json create mode 100644 TrustSDK/Resources/Images.xcassets/trust.shield.fill.imageset/trust_filled.pdf create mode 100644 TrustSDK/Resources/Images.xcassets/trust.shield.imageset/Contents.json create mode 100644 TrustSDK/Resources/Images.xcassets/trust.shield.imageset/trust_line.pdf create mode 100644 TrustSDK/Resources/en.lproj/Localizable.strings diff --git a/Example/Podfile.lock b/Example/Podfile.lock index 8af7375..31a58dc 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -33,7 +33,7 @@ SPEC CHECKSUMS: CryptoSwift: f12f037f6d0fcd6d48c96db0071b653de64e6c4d SwiftLint: 22ccbbe3b8008684be5955693bab135e0ed6a447 SwiftProtobuf: ecbec1be9036d15655f6b3443a1c4ea693c97932 - TrustSDK: 94db9da0d77fa9b8cd09e149639cefcb7b218cea + TrustSDK: ad622be6fa2aff65c2e330ba51cc3a5f95ead1b8 TrustWalletCore: cd0373c69fd9bf92700783287544ce6a9aab041b PODFILE CHECKSUM: 598c9b55b1a069a4a551d4116542d400689f4304 diff --git a/Example/TrustSDK.xcodeproj/project.pbxproj b/Example/TrustSDK.xcodeproj/project.pbxproj index 51a07c0..dbd75aa 100644 --- a/Example/TrustSDK.xcodeproj/project.pbxproj +++ b/Example/TrustSDK.xcodeproj/project.pbxproj @@ -11,7 +11,6 @@ 33758FFB3D21DDEAA9C93AA9 /* Pods_TrustSDK_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C5D9043738C8AAF9420A137C /* Pods_TrustSDK_Tests.framework */; }; 607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD51AFB9204008FA782 /* AppDelegate.swift */; }; 607FACD81AFB9204008FA782 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD71AFB9204008FA782 /* ViewController.swift */; }; - 607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 607FACD91AFB9204008FA782 /* Main.storyboard */; }; 607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDC1AFB9204008FA782 /* Images.xcassets */; }; 607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */; }; 607FACEC1AFB9204008FA782 /* RequestRegistryTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACEB1AFB9204008FA782 /* RequestRegistryTests.swift */; }; @@ -19,6 +18,7 @@ 7507FFE1240D75AE00DE2741 /* WalletResponseTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7507FFE0240D75AE00DE2741 /* WalletResponseTests.swift */; }; 7507FFE3240D774300DE2741 /* WalletRequestTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7507FFE2240D774300DE2741 /* WalletRequestTests.swift */; }; 7598AD192414175000421EFA /* DictionaryTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7598AD182414175000421EFA /* DictionaryTests.swift */; }; + 75CD0D8324A41DC300242DA3 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 75CD0D8224A41DC300242DA3 /* Main.storyboard */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -39,7 +39,6 @@ 607FACD41AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 607FACD51AFB9204008FA782 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 607FACD71AFB9204008FA782 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; - 607FACDA1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 607FACDC1AFB9204008FA782 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 607FACDF1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 607FACE51AFB9204008FA782 /* TrustSDK_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TrustSDK_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -49,6 +48,7 @@ 7507FFE0240D75AE00DE2741 /* WalletResponseTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WalletResponseTests.swift; sourceTree = ""; }; 7507FFE2240D774300DE2741 /* WalletRequestTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WalletRequestTests.swift; sourceTree = ""; }; 7598AD182414175000421EFA /* DictionaryTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DictionaryTests.swift; sourceTree = ""; }; + 75CD0D8224A41DC300242DA3 /* Main.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = ""; }; 8E3A0941E4AF3948909E87BE /* Pods-TrustSDK_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TrustSDK_Tests.release.xcconfig"; path = "Target Support Files/Pods-TrustSDK_Tests/Pods-TrustSDK_Tests.release.xcconfig"; sourceTree = ""; }; 973C7B142BAB8746D0C53AF2 /* TrustSDK.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = TrustSDK.podspec; path = ../TrustSDK.podspec; sourceTree = ""; }; 9CE43E415D1BA0F22441C393 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; @@ -114,7 +114,7 @@ children = ( 607FACD51AFB9204008FA782 /* AppDelegate.swift */, 607FACD71AFB9204008FA782 /* ViewController.swift */, - 607FACD91AFB9204008FA782 /* Main.storyboard */, + 75CD0D8224A41DC300242DA3 /* Main.storyboard */, 607FACDC1AFB9204008FA782 /* Images.xcassets */, 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */, 607FACD31AFB9204008FA782 /* Supporting Files */, @@ -266,7 +266,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */, + 75CD0D8324A41DC300242DA3 /* Main.storyboard in Resources */, 607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */, 607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */, ); @@ -404,14 +404,6 @@ /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ - 607FACD91AFB9204008FA782 /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 607FACDA1AFB9204008FA782 /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */ = { isa = PBXVariantGroup; children = ( diff --git a/Example/TrustSDK/Base.lproj/Main.storyboard b/Example/TrustSDK/Main.storyboard similarity index 56% rename from Example/TrustSDK/Base.lproj/Main.storyboard rename to Example/TrustSDK/Main.storyboard index 0aa9cc5..e0fb260 100644 --- a/Example/TrustSDK/Base.lproj/Main.storyboard +++ b/Example/TrustSDK/Main.storyboard @@ -1,81 +1,73 @@ - - + + + - + - - - - - - - - + + + + - - + + - - - - - + - - - + + + + + + + + + + - + - + diff --git a/Example/TrustSDK/ViewController.swift b/Example/TrustSDK/ViewController.swift index c60976a..3cf130c 100644 --- a/Example/TrustSDK/ViewController.swift +++ b/Example/TrustSDK/ViewController.swift @@ -11,12 +11,19 @@ import CryptoSwift import TrustWalletCore class ViewController: UIViewController { + @IBOutlet var signMesageButton: TrustButton! + @IBOutlet var signTransactionButton: TrustButton! + @IBOutlet var payWithTrustButton: TrustButton! + @IBOutlet var getAccountsButton: TrustButton! let meta = TrustSDK.SignMetadata.dApp(name: "Test", url: URL(string: "https://dapptest.com")) override func viewDidLoad() { super.viewDidLoad() - // Do any additional setup after loading the view, typically from a nib. + setupSignTransactionButton() + setupSignMessageButton() + setupGetAccountsButton() + setupPayWithTrustButton() } override func didReceiveMemoryWarning() { @@ -24,22 +31,22 @@ class ViewController: UIViewController { // Dispose of any resources that can be recreated. } - @IBAction func signEthereumTx(_ sender: UIButton) { - let input = EthereumSigningInput.with { - $0.toAddress = "0x728B02377230b5df73Aa4E3192E89b6090DD7312" - $0.chainID = BigInt("1").serialize()! - $0.nonce = BigInt("477").serialize()! - $0.gasPrice = BigInt("2112000000").serialize()! - $0.gasLimit = BigInt("21000").serialize()! - $0.amount = BigInt("100000000000000").serialize()! - } - - TrustSDK.signers.ethereum.sign(input: input, metadata: meta) { result in + func setupSignMessageButton() { + let data = Data("Some message".utf8) + let message = Data("\u{19}Ethereum Signed Message:\n\(data.count)".utf8) + let hash = message.sha3(.keccak256) + + signMesageButton.apply(theme: TrustButtonTheme + .blue + .with(styles: .title(.plain("Sign Message")), .icon(.trust), .roundFull) + ) + + signMesageButton.action = .signMessage(hash) { result in switch result { - case .success(let output): + case .success(let signature): let alert = UIAlertController( - title: "Transaction", - message: output.map({ String(format: "%02x", $0) }).joined(), + title: "Signature", + message: signature, preferredStyle: .alert ) alert.addAction(UIAlertAction(title: "Ok", style: .default, handler: nil)) @@ -50,16 +57,27 @@ class ViewController: UIViewController { } } - @IBAction func signEthereumMessage(_ sender: UIButton) { - let data = Data("Some message".utf8) - let message = Data("\u{19}Ethereum Signed Message:\n\(data.count)".utf8) - let hash = message.sha3(.keccak256) - TrustSDK.signers.ethereum.sign(message: hash) { result in + func setupSignTransactionButton() { + let input = EthereumSigningInput.with { + $0.toAddress = "0x728B02377230b5df73Aa4E3192E89b6090DD7312" + $0.chainID = BigInt("1").serialize()! + $0.nonce = BigInt("477").serialize()! + $0.gasPrice = BigInt("2112000000").serialize()! + $0.gasLimit = BigInt("21000").serialize()! + $0.amount = BigInt("100000000000000").serialize()! + } + + signTransactionButton.apply(theme: TrustButtonTheme + .white + .with(styles: .title(.plain("Sign Transaction")), .icon(.trust)) + ) + + signTransactionButton.action = .sign(signer: TrustSDK.signers.ethereum, input: input, metadata: meta) { result in switch result { - case .success(let signature): + case .success(let output): let alert = UIAlertController( - title: "Signature", - message: signature, + title: "Transaction", + message: output.map({ String(format: "%02x", $0) }).joined(), preferredStyle: .alert ) alert.addAction(UIAlertAction(title: "Ok", style: .default, handler: nil)) @@ -70,14 +88,19 @@ class ViewController: UIViewController { } } - @IBAction func signThenSendEthereum(_ sender: UIButton) { + func setupPayWithTrustButton() { let input = EthereumSigningInput.with { $0.toAddress = "0x728B02377230b5df73Aa4E3192E89b6090DD7312" $0.chainID = BigInt("1").serialize()! $0.amount = BigInt("100000000000000").serialize()! } - - TrustSDK.signers.ethereum.signThenSend(input: input, metadata: meta) { result in + + payWithTrustButton.apply(theme: TrustButtonTheme + .black + .with(styles: .title(.payWithTrust(icon: .shieldLined))) + ) + + payWithTrustButton.action = .signThenSend(signer: TrustSDK.signers.ethereum, input: input, metadata: meta) { (result) in switch result { case .success(let output): let alert = UIAlertController( @@ -93,8 +116,13 @@ class ViewController: UIViewController { } } - @IBAction func getAddress(_ sender: UIButton) { - TrustSDK.getAccounts(for: [.ethereum, .binance]) { result in + func setupGetAccountsButton() { + getAccountsButton.apply(theme: TrustButtonTheme + .white + .with(styles: .title(.plain("Get Accounts")), .icon(.trust), .roundFull) + ) + + getAccountsButton.action = .getAccounts(coins: [.ethereum, .binance]) { result in switch result { case .success(let addresses): let alert = UIAlertController( diff --git a/TrustSDK.podspec b/TrustSDK.podspec index 94f1ee8..6d5bf95 100644 --- a/TrustSDK.podspec +++ b/TrustSDK.podspec @@ -11,6 +11,9 @@ Pod::Spec.new do |s| s.default_subspec = 'Client' s.subspec 'Client' do |cs| + cs.resource_bundles = { + 'TrustSDK' => ['TrustSDK/Resources/**/*.xcassets', 'TrustSDK/Resources/**/*.strings'] + } cs.source_files = 'TrustSDK/Classes/Client/**/*' cs.dependency 'TrustWalletCore/Types' cs.dependency 'BigInt' diff --git a/TrustSDK/Classes/Client/Extensions/String.swift b/TrustSDK/Classes/Client/Extensions/String.swift index eec9fcd..1b60956 100644 --- a/TrustSDK/Classes/Client/Extensions/String.swift +++ b/TrustSDK/Classes/Client/Extensions/String.swift @@ -33,3 +33,9 @@ extension String { return Bool(self) ?? false } } + +extension String { + func localized(comment: String = "") -> String { + return NSLocalizedString(self, bundle: TrustSDK.resourceBundle, comment: comment) + } +} diff --git a/TrustSDK/Classes/Client/UI/Colors.swift b/TrustSDK/Classes/Client/UI/Colors.swift new file mode 100644 index 0000000..bf95f88 --- /dev/null +++ b/TrustSDK/Classes/Client/UI/Colors.swift @@ -0,0 +1,26 @@ +// Copyright Trust Wallet. All rights reserved. +// +// This file is part of TrustSDK. The full TrustSDK copyright notice, including +// terms governing use, modification, and redistribution, is contained in the +// file LICENSE at the root of the source code distribution tree. + +import UIKit + +extension TrustSDK { + public struct Colors { + static let white = color(light: .white, dark: .white) + static let light = color(light: .white, dark: .black) + static let black = color(light: .black, dark: .black) + static let blue = color(light: UIColor(hex: 0x2e91db), dark: UIColor(hex: 0x4390E2)) + + internal static func color(light: UIColor, dark: UIColor) -> UIColor { + if #available(iOS 13.0, *) { + return UIColor { (traits) -> UIColor in + return traits.userInterfaceStyle == .dark ? dark : light + } + } else { + return light + } + } + } +} diff --git a/TrustSDK/Classes/Client/UI/Icons.swift b/TrustSDK/Classes/Client/UI/Icons.swift new file mode 100644 index 0000000..b6d9479 --- /dev/null +++ b/TrustSDK/Classes/Client/UI/Icons.swift @@ -0,0 +1,36 @@ +// Copyright Trust Wallet. All rights reserved. +// +// This file is part of TrustSDK. The full TrustSDK copyright notice, including +// terms governing use, modification, and redistribution, is contained in the +// file LICENSE at the root of the source code distribution tree. + +import UIKit + +extension TrustSDK { + public static let resourceBundle: Bundle = { + let bundle = Bundle(for: TrustSDK.self) + guard let resourceBundleUrl = bundle.url(forResource: "TrustSDK", withExtension: "bundle") else { + fatalError("TrustSDK.bundle not found!") + } + guard let resourceBundle = Bundle(url: resourceBundleUrl) else { + fatalError("Could not access TrustSDK.bundle") + } + return resourceBundle + }() + + public enum Icon { + case trust, shieldFilled, shieldLined + + public var image: UIImage? { + switch self { + case .trust: + return UIImage(named: "trust", in: TrustSDK.resourceBundle, compatibleWith: nil) + case .shieldFilled: + return UIImage(named: "trust.shield.fill", in: TrustSDK.resourceBundle, compatibleWith: nil) + case .shieldLined: + return UIImage(named: "trust.shield", in: TrustSDK.resourceBundle, compatibleWith: nil) + } + } + } + +} diff --git a/TrustSDK/Classes/Client/UI/TrustButton.swift b/TrustSDK/Classes/Client/UI/TrustButton.swift new file mode 100644 index 0000000..17125fe --- /dev/null +++ b/TrustSDK/Classes/Client/UI/TrustButton.swift @@ -0,0 +1,111 @@ +// Copyright Trust Wallet. All rights reserved. +// +// This file is part of TrustSDK. The full TrustSDK copyright notice, including +// terms governing use, modification, and redistribution, is contained in the +// file LICENSE at the root of the source code distribution tree. + +import UIKit +import TrustWalletCore + +public final class TrustButton: UIButton { + public enum Action { + case getAccounts( + coins: [CoinType], + callback: ((Result<[String], Error>) -> Void) + ) + + case signMessage(Data, + metadata: TrustSDK.SignMetadata? = nil, + callback: ((Result) -> Void) + ) + + case sign( + signer: TrustSDK.Signer, + input: SigningInput, + metadata: TrustSDK.SignMetadata? = nil, + callback: ((Result) -> Void) + ) + + case signThenSend( + signer: TrustSDK.Signer, + input: SigningInput, + metadata: TrustSDK.SignMetadata? = nil, + callback: ((Result) -> Void) + ) + } + + private var isFullRounded: Bool = false + public var action: Action? + + public override init(frame: CGRect) { + super.init(frame: frame) + initialize() + } + + public required init?(coder: NSCoder) { + super.init(coder: coder) + initialize() + } + + private func initialize() { + self.apply(theme: .blue) + self.addTarget(self, action: #selector(didPress), for: .touchUpInside) + } + + public func apply(theme: TrustButtonTheme) { + for style in theme.styles { + apply(style: style) + } + } + + @objc func didPress() { + switch action { + case let .getAccounts(coins, callback): + TrustSDK.getAccounts(for: coins, callback: callback) + case let .sign(signer, input, metadata, callback): + signer.sign(input: input, metadata: metadata, callback: callback) + case let .signThenSend(signer, input, metadata, callback): + signer.signThenSend(input: input, metadata: metadata, callback: callback) + case let .signMessage(message, metadata, callback): + TrustSDK.signers.ethereum.sign(message: message, metadata: metadata, callback: callback) + case .none: + break + } + } + + func apply(style: TrustButtonStyle) { + switch style { + case let .font(font): + self.titleLabel?.font = font + case let .title(style): + guard let font = self.titleLabel?.font else { + return + } + self.setAttributedTitle(style.title(font: font), for: .normal) + case let .icon(icon, insets): + self.setImage(icon.image, for: .normal) + self.imageView?.contentMode = .scaleAspectFit + self.imageEdgeInsets = insets + case let .tintColor(color): + self.tintColor = color + case let .backgroundColor(color): + self.backgroundColor = color + case let .border(width, color): + self.layer.borderColor = color.cgColor + self.layer.borderWidth = width + case let .round(radius): + self.layer.cornerRadius = radius + self.isFullRounded = false + case .roundFull: + self.layer.cornerRadius = 0 + self.isFullRounded = true + } + } + + public override func layoutSubviews() { + super.layoutSubviews() + if isFullRounded { + self.layer.cornerRadius = self.bounds.height / 2.0 + } + } +} diff --git a/TrustSDK/Classes/Client/UI/TrustButtonTheme.swift b/TrustSDK/Classes/Client/UI/TrustButtonTheme.swift new file mode 100644 index 0000000..cfc5864 --- /dev/null +++ b/TrustSDK/Classes/Client/UI/TrustButtonTheme.swift @@ -0,0 +1,123 @@ +// Copyright Trust Wallet. All rights reserved. +// +// This file is part of TrustSDK. The full TrustSDK copyright notice, including +// terms governing use, modification, and redistribution, is contained in the +// file LICENSE at the root of the source code distribution tree. + +import Foundation + +public struct TrustButtonTheme { + let styles: [TrustButtonStyle] + + public init(_ styles: TrustButtonStyle...) { + self.styles = styles + } + + init(styles: [TrustButtonStyle]) { + self.styles = styles + } + + public func with(styles: TrustButtonStyle...) -> TrustButtonTheme { + let current = self.styles.filter { !styles.contains($0) } + return TrustButtonTheme(styles: current + styles) + } + + public static let white = TrustButtonTheme( + .font(.systemFont(ofSize: 18, weight: .regular)), + .tintColor(TrustSDK.Colors.blue), + .backgroundColor(TrustSDK.Colors.light), + .border(width: 1, color: TrustSDK.Colors.blue), + .round(radius: 8.0) + ) + + public static let blue = TrustButtonTheme( + .font(.systemFont(ofSize: 18, weight: .regular)), + .tintColor(TrustSDK.Colors.white), + .backgroundColor(TrustSDK.Colors.blue), + .round(radius: 8.0) + ) + + public static let black = TrustButtonTheme( + .font(.systemFont(ofSize: 18, weight: .regular)), + .tintColor(TrustSDK.Colors.white), + .backgroundColor(TrustSDK.Colors.black), + .border(width: 1, color: TrustSDK.Colors.white), + .round(radius: 8.0) + ) +} + +enum TrustButtonStyleName: String { + case icon + case font + case title + case backgroundColor + case tintColor + case border + case round + case roundFull +} + +public enum TrustButtonTitleStyle { + case plain(String) + case payWithTrust(icon: TrustSDK.Icon, size: CGSize = CGSize(width: 20, height: 20)) + + func title(font: UIFont) -> NSAttributedString { + switch self { + case .plain(let title): + return NSAttributedString(string: title) + case let .payWithTrust(icon, iconSize): + let titleString = NSMutableAttributedString(string: "Pay with".localized()) + titleString.append(NSAttributedString(string: " ")) + + let iconAttachment = NSTextAttachment() + iconAttachment.image = icon.image + iconAttachment.bounds = CGRect(origin: CGPoint(x: 0, y: (font.capHeight - iconSize.height) / 2), size: iconSize) + + titleString.append(NSAttributedString(attachment: iconAttachment)) + titleString.append(NSAttributedString(string: "Wallet".localized())) + + return titleString + } + + } +} + +public enum TrustButtonStyle { + case backgroundColor(UIColor) + case tintColor(UIColor) + case font(UIFont) + case icon(TrustSDK.Icon, insets: UIEdgeInsets = UIEdgeInsets(top: 5.0, left: 0, bottom: 5.0, right: 8.0)) + case title(TrustButtonTitleStyle) + case border(width: CGFloat, color: UIColor) + case round(radius: CGFloat) + case roundFull + + var name: TrustButtonStyleName { + switch self { + case .icon: return .icon + case .font: return .font + case .title: return .title + case .backgroundColor: return .backgroundColor + case .tintColor: return .tintColor + case .border: return .border + case .round: return .round + case .roundFull: return .roundFull + } + } +} + +extension TrustButtonStyle: Hashable { + public static func == (lhs: TrustButtonStyle, rhs: TrustButtonStyle) -> Bool { + return lhs.name == rhs.name + } + + public func hash(into hasher: inout Hasher) { + self.name.hash(into: &hasher) + } +} + +extension Array where Element == TrustButtonStyle { + func unique() -> [Element] { + return Array(Set(self)) + } +} diff --git a/TrustSDK/Classes/Client/UI/UIColor+Hex.swift b/TrustSDK/Classes/Client/UI/UIColor+Hex.swift new file mode 100644 index 0000000..e37b8b4 --- /dev/null +++ b/TrustSDK/Classes/Client/UI/UIColor+Hex.swift @@ -0,0 +1,21 @@ +// Copyright Trust Wallet. All rights reserved. +// +// This file is part of TrustSDK. The full TrustSDK copyright notice, including +// terms governing use, modification, and redistribution, is contained in the +// file LICENSE at the root of the source code distribution tree. + +import Foundation + +extension UIColor { + convenience init(hex: UInt64) { + let red = (hex & 0xff0000) >> 16 + let green = (hex & 0xff00) >> 8 + let blue = hex & 0xff + + self.init( + red: CGFloat(red) / 0xff, + green: CGFloat(green) / 0xff, + blue: CGFloat(blue) / 0xff, alpha: 1 + ) + } +} diff --git a/TrustSDK/Assets/.gitkeep b/TrustSDK/Resources/.gitkeep similarity index 100% rename from TrustSDK/Assets/.gitkeep rename to TrustSDK/Resources/.gitkeep diff --git a/TrustSDK/Resources/Images.xcassets/Contents.json b/TrustSDK/Resources/Images.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/TrustSDK/Resources/Images.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/TrustSDK/Resources/Images.xcassets/trust.imageset/Contents.json b/TrustSDK/Resources/Images.xcassets/trust.imageset/Contents.json new file mode 100644 index 0000000..074c5a4 --- /dev/null +++ b/TrustSDK/Resources/Images.xcassets/trust.imageset/Contents.json @@ -0,0 +1,16 @@ +{ + "images" : [ + { + "filename" : "trust_icon.pdf", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + }, + "properties" : { + "preserves-vector-representation" : true, + "template-rendering-intent" : "template" + } +} diff --git a/TrustSDK/Resources/Images.xcassets/trust.imageset/trust_icon.pdf b/TrustSDK/Resources/Images.xcassets/trust.imageset/trust_icon.pdf new file mode 100644 index 0000000000000000000000000000000000000000..674bd3648172d42fe5796483029aed0564e4d79f GIT binary patch literal 6348 zcmbtZXH-+$wx$XM4x%(ELPUB^fKa4KuNr!92?V4@LkAH-iU>%TCL&!x5DiE(^eRH6 zgGg`ErAS9!Kt1Ppy>Gl9Z;v&y_n3RGHp`c}zRjVnq#^(o6ajEF&uz{v=Wjj#*xU*b z1%iM`xFbMX8YrZNaJ6^81%%*4x zrCDP!+0gU?lW~&ob?LRA#}B5ptd7OUkysxs^TBW1Nk;k%NFk)d33TDgQSIegg<4pE zUCsF6*O!a?n|}Cr>-?*{!0R)wGG&ckzK6*+Jz3tXbjPBS97p3m1~zmhRmiV+mn#cL z+WXB*rnNh|t)jFN7!N1eMI6Qj`S0yy*6>GQMqBjYW0%ba-$2u*zsbHCE8i-&8jX9$ zmwh$-)~XnP5~Z?fcnyK`<5!Di(wn5VEalk|=$PjO7UnH47`U33bVKwzAAf1PQD)Y| zpqn@RMXj-bY_#Ju`RJ#-V3G&vl$ zIp=$F;@kM-j(PJP_Lbj#%^lf4|C;=Z&8ObdOXuFbVPvY%BeoE}N{L^p<_Y~OfbJJ4 zne8rQq?JIEUK6m@74_drea|7`BUt&sp(#C@zSd>baUUM2cE^+(`fLwqz0`@)6vPr# zjgmjACZf7oAeAt4UJ;^BV&{FC_|2Me^p&6|$wtz*)hD0t(!q%sA5g~HVak_`vP}qH zK4tYi*OlzYCs}I1_)UyYLw=(BBqgXKV&q`~-K4sDA!R?SxWAL60Yf@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*~#0tRq!C__~M{{sp3>D2%L literal 0 HcmV?d00001 diff --git a/TrustSDK/Resources/Images.xcassets/trust.shield.fill.imageset/Contents.json b/TrustSDK/Resources/Images.xcassets/trust.shield.fill.imageset/Contents.json new file mode 100644 index 0000000..e77a1b4 --- /dev/null +++ b/TrustSDK/Resources/Images.xcassets/trust.shield.fill.imageset/Contents.json @@ -0,0 +1,16 @@ +{ + "images" : [ + { + "filename" : "trust_filled.pdf", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + }, + "properties" : { + "preserves-vector-representation" : true, + "template-rendering-intent" : "template" + } +} diff --git a/TrustSDK/Resources/Images.xcassets/trust.shield.fill.imageset/trust_filled.pdf b/TrustSDK/Resources/Images.xcassets/trust.shield.fill.imageset/trust_filled.pdf new file mode 100644 index 0000000000000000000000000000000000000000..4cc2e4d498292bd345a3831a46f5061a639909ca GIT binary patch literal 5915 zcmbuDXH*m4*2ZZH1Oy93iZCLfmn0+( zlrzYi6q6*48?>Sg^}A2TE5CGoEp4qBM}pv=v+>{O*%4cLqz>*lX(l8qpSh-*ncE=v zQA@;(sbK9IyiZ#$z4vy~`EqZD0bIHI85K?GTPN?p`fgm7l<;o}$KYzLJVPh!%JPIswyH91-kl3z8bNjOU~~** z;kq>HbU9!^*T=usRt(AivM#S@;^|nl3X;n>QaHH=(vjc7&(}NpcW^zs;2 zY1(KcJV9VkeITKj*6=-~fR>uD;L!arENJE%7{#tW_;qa;w&Oo=&nJSC<&@KChWo$^ z`M&!0CD*jGh5YE`oD;n^>^Vbf2_#fT3T*V!VsxjS>t{&H*_y&H_k^{3NZ%ysjk%R! z&INm75&sm|c|j@AnM@_GpyU{botU$vte5XeD|y%OsZQKCZdc&gH`6wORDt~9%>b3~ z<|v96#eD$|+i^6k+N@7pAm;~(KDffg;0F&6ZehR4;j)h_ z1`yRj*&Y7kFfQ(Z*biywVcf7DIBSd>ApXOkgmrNzK6e8SlS3P}8X`?m%TOuriVsZYs6um7q~(H~>})v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z z-7Q7D2v(z&(e;yz)j!vC;Euajkd z$ymGif|s&H(`3n)^3RUF(C3XgjSYB7zKwfa2Zj}dG#0(KccL7^*k_k39(hfN1}~{d9cR0p z;_z^%+vKHD@2NbAT{ORi$`|bFi|Un5UOdfqm*VyQ`+ENE0Vzu4uPwnHQJy_$|A*yM z0;lsqLRg*lOm!_@lydk71DKL@ zvJ=Mc<@|4C*)=KB`8Ozs!xy!)F06p2-X6~6r*%Z#&j2xFFfSPo_l5;WiFqTmd`o!XPz-9AGlo8FshwqYk9UjGbo=50fiW37QrdR-sxwif7m z`C$I27lW}5AaS9)o6AK;uB$fxQR(sjR`Oh)^}H1BT(8kgC*6T2QdKCZxT%<^Wt?m5rt zebDbQLSLqsJV++%iWnBBSZ~wInfYR!J&B#5y+Uoj8b4HUFL;<<)iGto8oF*g*(48P zi;Out#`=i*`f)nyF`oy4HMbr%rGD-@xjxOm%Reh7eX*X0zGwiQYEXq0@P0MTlSn1y zW2DTy@Uc?so$DK@et5f(gP7;-xMp|lrAyT*&h?@7_BXF~`-WH@ntE*ctln+~$qO*_ zw9T-Ihq%vDte#EtmbFjrdMUlOQ-A5Xiucy#t@s`8w8C!>MqBkRs<_ zh)5TQceZwP0E<9{;lDrs+k{96!rax2#BO=*F=l9O@UKUp5Md}n7y&lom36hYBNc0; zA`}8O;sa~CV(>0rU=lp~&YL`3_()SGVO|%~i{web0mv(V1qOjZAYw2WOjHyC7c+oB zct|@*Pu~ECl!S5qsRtEB{4pL>RGb8F{;7w6 zAGz17>LLD^9~^e{i~CPKgedY4J(A^qTZaoCV{M1Se@FS+)?PT0 zok`@)(UBB*N5Mrx`pOO#j-)93aV<}Z!>e#JEcUX6_+>Ms7|g;9ioJ}4!5~-+$q6uX hggDGx3i!WOe#Eh}3n_-aI~XA@M*5S1O98D2{1^2ozt;c& literal 0 HcmV?d00001 diff --git a/TrustSDK/Resources/en.lproj/Localizable.strings b/TrustSDK/Resources/en.lproj/Localizable.strings new file mode 100644 index 0000000..9a9bac8 --- /dev/null +++ b/TrustSDK/Resources/en.lproj/Localizable.strings @@ -0,0 +1,3 @@ +"Pay with"="Pay with"; +"Trust Wallet"="Trust Wallet"; +"Wallet"="Wallet";