Skip to content
This repository has been archived by the owner on Aug 13, 2021. It is now read-only.

Commit

Permalink
Pay with Trust Button (#51)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
leoneparise authored Jun 25, 2020
1 parent eca43e1 commit 7d954f3
Show file tree
Hide file tree
Showing 20 changed files with 483 additions and 88 deletions.
2 changes: 1 addition & 1 deletion Example/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ SPEC CHECKSUMS:
CryptoSwift: f12f037f6d0fcd6d48c96db0071b653de64e6c4d
SwiftLint: 22ccbbe3b8008684be5955693bab135e0ed6a447
SwiftProtobuf: ecbec1be9036d15655f6b3443a1c4ea693c97932
TrustSDK: 94db9da0d77fa9b8cd09e149639cefcb7b218cea
TrustSDK: ad622be6fa2aff65c2e330ba51cc3a5f95ead1b8
TrustWalletCore: cd0373c69fd9bf92700783287544ce6a9aab041b

PODFILE CHECKSUM: 598c9b55b1a069a4a551d4116542d400689f4304
Expand Down
16 changes: 4 additions & 12 deletions Example/TrustSDK.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
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 */; };
7507FFDF240D73BD00DE2741 /* CommandTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7507FFDD240D738100DE2741 /* CommandTests.swift */; };
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 */
Expand All @@ -39,7 +39,6 @@
607FACD41AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
607FACD51AFB9204008FA782 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
607FACD71AFB9204008FA782 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
607FACDA1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
607FACDC1AFB9204008FA782 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
607FACDF1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; };
607FACE51AFB9204008FA782 /* TrustSDK_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TrustSDK_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
Expand All @@ -49,6 +48,7 @@
7507FFE0240D75AE00DE2741 /* WalletResponseTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WalletResponseTests.swift; sourceTree = "<group>"; };
7507FFE2240D774300DE2741 /* WalletRequestTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WalletRequestTests.swift; sourceTree = "<group>"; };
7598AD182414175000421EFA /* DictionaryTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DictionaryTests.swift; sourceTree = "<group>"; };
75CD0D8224A41DC300242DA3 /* Main.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = "<group>"; };
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 = "<group>"; };
973C7B142BAB8746D0C53AF2 /* TrustSDK.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = TrustSDK.podspec; path = ../TrustSDK.podspec; sourceTree = "<group>"; };
9CE43E415D1BA0F22441C393 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = "<group>"; };
Expand Down Expand Up @@ -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 */,
Expand Down Expand Up @@ -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 */,
);
Expand Down Expand Up @@ -404,14 +404,6 @@
/* End PBXTargetDependency section */

/* Begin PBXVariantGroup section */
607FACD91AFB9204008FA782 /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
607FACDA1AFB9204008FA782 /* Base */,
);
name = Main.storyboard;
sourceTree = "<group>";
};
607FACDE1AFB9204008FA782 /* LaunchScreen.xib */ = {
isa = PBXVariantGroup;
children = (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,81 +1,73 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="16097" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="vXZ-lx-hvc">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="16097" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="bKd-Yx-GdX">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="ufC-wZ-h7g">
<scene sceneID="Hwk-cW-wCM">
<objects>
<viewController id="vXZ-lx-hvc" customClass="ViewController" customModule="TrustSDK_Example" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="jyV-Pf-zRb"/>
<viewControllerLayoutGuide type="bottom" id="2fi-mo-0CV"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="kh9-bI-dsS">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<viewController id="bKd-Yx-GdX" customClass="ViewController" customModule="TrustSDK_Example" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="BMG-7a-Weg">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="dki-rz-1JK">
<rect key="frame" x="16" y="238.5" width="343" height="190"/>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="aUU-ev-Dni">
<rect key="frame" x="10" y="345" width="394" height="206"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="QBa-rx-udO">
<rect key="frame" x="0.0" y="0.0" width="343" height="40"/>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="HIS-AH-w2S" customClass="TrustButton" customModule="TrustSDK">
<rect key="frame" x="0.0" y="0.0" width="394" height="44"/>
<constraints>
<constraint firstAttribute="height" constant="40" id="ePi-zJ-VrN"/>
<constraint firstAttribute="height" constant="44" id="sic-Tt-hbJ"/>
</constraints>
<state key="normal" title="Sign Ethereum Tx"/>
<connections>
<action selector="signEthereumTx:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="jY8-nu-Vmt"/>
</connections>
<state key="normal" title="Pay With Trust Wallet"/>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Zjp-TZ-lI6">
<rect key="frame" x="0.0" y="50" width="343" height="40"/>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="p1S-1Y-idx" customClass="TrustButton" customModule="TrustSDK">
<rect key="frame" x="0.0" y="54" width="394" height="44"/>
<constraints>
<constraint firstAttribute="height" constant="40" id="Z99-F6-ZKN"/>
<constraint firstAttribute="height" constant="44" id="tbl-cf-e0c"/>
</constraints>
<state key="normal" title="Sign Ethereum Message"/>
<connections>
<action selector="signEthereumMessage:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="jqF-di-XOu"/>
</connections>
<state key="normal" title="Sign Message"/>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="fNZ-Tw-waq">
<rect key="frame" x="0.0" y="100" width="343" height="40"/>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="2hN-tm-JCp" customClass="TrustButton" customModule="TrustSDK">
<rect key="frame" x="0.0" y="108" width="394" height="44"/>
<constraints>
<constraint firstAttribute="height" constant="40" id="pjM-mw-3MG"/>
<constraint firstAttribute="height" constant="44" id="pnC-S1-Bxv"/>
</constraints>
<state key="normal" title="Sign and Send Ethereum"/>
<connections>
<action selector="signThenSendEthereum:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="lYt-Tw-aEN"/>
</connections>
<state key="normal" title="Sign Transaction"/>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Y0Q-XG-P2U">
<rect key="frame" x="0.0" y="150" width="343" height="40"/>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="RsQ-QJ-aVh" customClass="TrustButton" customModule="TrustSDK">
<rect key="frame" x="0.0" y="162" width="394" height="44"/>
<constraints>
<constraint firstAttribute="height" constant="40" id="Prt-SF-Pwk"/>
<constraint firstAttribute="height" constant="44" id="wI1-gL-oJt"/>
</constraints>
<state key="normal" title="Get Address"/>
<connections>
<action selector="getAddress:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="DCl-ir-FRN"/>
</connections>
<state key="normal" title="Get Accounts"/>
</button>
</subviews>
</stackView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstItem="dki-rz-1JK" firstAttribute="centerY" secondItem="kh9-bI-dsS" secondAttribute="centerY" id="0pi-b8-mWM"/>
<constraint firstItem="dki-rz-1JK" firstAttribute="leading" secondItem="kh9-bI-dsS" secondAttribute="leadingMargin" id="9Bc-5m-zSq"/>
<constraint firstAttribute="trailingMargin" secondItem="dki-rz-1JK" secondAttribute="trailing" id="9vL-Bf-RQO"/>
<constraint firstItem="dc4-Ce-UIv" firstAttribute="trailing" secondItem="aUU-ev-Dni" secondAttribute="trailing" constant="10" id="9qM-sM-gob"/>
<constraint firstItem="aUU-ev-Dni" firstAttribute="centerY" secondItem="BMG-7a-Weg" secondAttribute="centerY" id="H4g-MP-103"/>
<constraint firstItem="aUU-ev-Dni" firstAttribute="leading" secondItem="dc4-Ce-UIv" secondAttribute="leading" constant="10" id="PRu-16-XcP"/>
</constraints>
<viewLayoutGuide key="safeArea" id="dc4-Ce-UIv"/>
</view>
<connections>
<outlet property="getAccountsButton" destination="RsQ-QJ-aVh" id="qVi-OD-oSh"/>
<outlet property="payWithTrustButton" destination="HIS-AH-w2S" id="GuI-JK-mtU"/>
<outlet property="signMesageButton" destination="p1S-1Y-idx" id="Zqi-tP-CFO"/>
<outlet property="signTransactionButton" destination="2hN-tm-JCp" id="Lrh-I2-up7"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="x5A-6p-PRh" sceneMemberID="firstResponder"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="56e-h5-MGR" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="140" y="132.68365817091455"/>
<point key="canvasLocation" x="-341" y="-48"/>
</scene>
</scenes>
</document>
Loading

0 comments on commit 7d954f3

Please sign in to comment.