From b992bb513b039b2ab139a3c8836a698919089f4c Mon Sep 17 00:00:00 2001 From: Michael Scoff Date: Sat, 18 Nov 2017 23:47:31 -0800 Subject: [PATCH] Add exchange coordinator, view controller, tab (#81) --- Trust.xcodeproj/project.pbxproj | 32 ++++++++++++++++++ .../exchange.imageset/Contents.json | 21 ++++++++++++ .../exchange.imageset/exchange.png | Bin 0 -> 1052 bytes .../Coordinators/ExchangeCoordinator.swift | 25 ++++++++++++++ .../ExchangeViewController.swift | 8 +++++ Trust/InCoordinator.swift | 8 +++++ 6 files changed, 94 insertions(+) create mode 100644 Trust/Assets.xcassets/exchange.imageset/Contents.json create mode 100644 Trust/Assets.xcassets/exchange.imageset/exchange.png create mode 100644 Trust/Exchange/Coordinators/ExchangeCoordinator.swift create mode 100644 Trust/Exchange/ViewConrtrollers/ExchangeViewController.swift diff --git a/Trust.xcodeproj/project.pbxproj b/Trust.xcodeproj/project.pbxproj index 946be2cea..ffac6b0f1 100644 --- a/Trust.xcodeproj/project.pbxproj +++ b/Trust.xcodeproj/project.pbxproj @@ -140,6 +140,8 @@ 298542FB1FBEA03300CB5081 /* SendInputErrors.swift in Sources */ = {isa = PBXBuildFile; fileRef = 298542FA1FBEA03300CB5081 /* SendInputErrors.swift */; }; 298542FE1FBEADEF00CB5081 /* TransactionCellViewModelTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 298542FD1FBEADEF00CB5081 /* TransactionCellViewModelTests.swift */; }; 298543001FBEAE2F00CB5081 /* ChainState.swift in Sources */ = {isa = PBXBuildFile; fileRef = 298542FF1FBEAE2F00CB5081 /* ChainState.swift */; }; + 298543041FC15F6D00CB5081 /* ExchangeCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 298543031FC15F6D00CB5081 /* ExchangeCoordinator.swift */; }; + 298543071FC15FB500CB5081 /* ExchangeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 298543061FC15FB500CB5081 /* ExchangeViewController.swift */; }; 2995739F1FA1F294006F17FD /* QRURLParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2995739E1FA1F294006F17FD /* QRURLParser.swift */; }; 299573A21FA1F369006F17FD /* QRURLParserTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 299573A11FA1F369006F17FD /* QRURLParserTests.swift */; }; 299573A41FA27A15006F17FD /* TestKeyStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = 299573A31FA27A15006F17FD /* TestKeyStore.swift */; }; @@ -386,6 +388,8 @@ 298542FA1FBEA03300CB5081 /* SendInputErrors.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SendInputErrors.swift; sourceTree = ""; }; 298542FD1FBEADEF00CB5081 /* TransactionCellViewModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TransactionCellViewModelTests.swift; sourceTree = ""; }; 298542FF1FBEAE2F00CB5081 /* ChainState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChainState.swift; sourceTree = ""; }; + 298543031FC15F6D00CB5081 /* ExchangeCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExchangeCoordinator.swift; sourceTree = ""; }; + 298543061FC15FB500CB5081 /* ExchangeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExchangeViewController.swift; sourceTree = ""; }; 2995739E1FA1F294006F17FD /* QRURLParser.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QRURLParser.swift; sourceTree = ""; }; 299573A11FA1F369006F17FD /* QRURLParserTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QRURLParserTests.swift; sourceTree = ""; }; 299573A31FA27A15006F17FD /* TestKeyStore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestKeyStore.swift; sourceTree = ""; }; @@ -554,6 +558,7 @@ 2912CCF71F6A830700C6CBE3 /* Trust */ = { isa = PBXGroup; children = ( + 298543011FC15F5300CB5081 /* Exchange */, 2959960F1FAB065700DB66A8 /* Deposit */, 29AD8A0A1F93FBB7008E10E7 /* Foundation */, 290B2B511F8F4F840053C83E /* Localization */, @@ -1109,6 +1114,31 @@ path = "New Group"; sourceTree = ""; }; + 298543011FC15F5300CB5081 /* Exchange */ = { + isa = PBXGroup; + children = ( + 298543051FC15FA200CB5081 /* ViewConrtrollers */, + 298543021FC15F6100CB5081 /* Coordinators */, + ); + path = Exchange; + sourceTree = ""; + }; + 298543021FC15F6100CB5081 /* Coordinators */ = { + isa = PBXGroup; + children = ( + 298543031FC15F6D00CB5081 /* ExchangeCoordinator.swift */, + ); + path = Coordinators; + sourceTree = ""; + }; + 298543051FC15FA200CB5081 /* ViewConrtrollers */ = { + isa = PBXGroup; + children = ( + 298543061FC15FB500CB5081 /* ExchangeViewController.swift */, + ); + path = ViewConrtrollers; + sourceTree = ""; + }; 299573A01FA1F35B006F17FD /* Foundation */ = { isa = PBXGroup; children = ( @@ -1951,6 +1981,7 @@ 296AF9A91F737F6F0058AF78 /* SendRawTransactionRequest.swift in Sources */, 2912CD2F1F6A83A100C6CBE3 /* ImportWalletViewController.swift in Sources */, 2996F1501F6CA80C005C33AE /* ExportError.swift in Sources */, + 298543041FC15F6D00CB5081 /* ExchangeCoordinator.swift in Sources */, 2996F1461F6C98B3005C33AE /* SettingsViewController.swift in Sources */, 2963B6AD1F981A96003063C1 /* TransactionAppearance.swift in Sources */, 29850D2B1F6B30FF00791A49 /* TransactionViewController.swift in Sources */, @@ -1976,6 +2007,7 @@ 293248841F88CCD2008A9818 /* SplashState.swift in Sources */, 291F52BC1F6B8D0600B369AB /* Account.swift in Sources */, 291794FB1F95DC2200539A30 /* Web3Swift.swift in Sources */, + 298543071FC15FB500CB5081 /* ExchangeViewController.swift in Sources */, 29DBF2A31F9DBFF400327C60 /* BackupCoordinator.swift in Sources */, 290B2B611F9179880053C83E /* AccountViewModel.swift in Sources */, 2963B6C11F9AE0E4003063C1 /* Data.swift in Sources */, diff --git a/Trust/Assets.xcassets/exchange.imageset/Contents.json b/Trust/Assets.xcassets/exchange.imageset/Contents.json new file mode 100644 index 000000000..358119cd7 --- /dev/null +++ b/Trust/Assets.xcassets/exchange.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "exchange.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Trust/Assets.xcassets/exchange.imageset/exchange.png b/Trust/Assets.xcassets/exchange.imageset/exchange.png new file mode 100644 index 0000000000000000000000000000000000000000..e46cbf61a39a76614b4f98c86268439d9f4c6f92 GIT binary patch literal 1052 zcmeAS@N?(olHy`uVBq!ia0vp^ULefD1|(%J94Z7-EX7WqAsj$Z!;#Vf4nJ zh}3{E9gP2NHH)l&-8S0 z45^s&_KtUljH|?fkMn1-lwW_*^t+?qS;SE3*}8-a!2%O!{9xc*WX>vDqw?rrv)i7I zDslce7X6Epoer?exw!D}GgWF*c(P34QS*_~#|yV@4&8itcWYU>@0NcT3~YmI?wkLg z`)Xb5uUTG8gJ#B@du4EK?hfYp5Bm8Y{}WCt6fpj=u0WUbd!nQ|YvA+gy2rbxHds{dBuS!&$AzA7Hu+1)?cSJ#r|R8W7ea`&39}F zX`FnZ`BMC)?-ySuTgc6=@B3+#I_;_A$|dF-t*z{vY=a`>6A}+d=^y*NBm2M{PJZv@ z*P>?}(p#yqBU0Pt3>v9I{La%zpe^pCb8 z2d$T~KJN3kcQ(}mO?w%CO>)Pr1K!Q*OD4q~pEl9(b!U@w%hjrykN5BS?@T>0@yM}7 zKlo2e&CPr7wLIFVPh&@@6>tBm=S=&V*FOy4-za?UXnc^T@#~)RqO98=p3nGm`Tw>X zhBAGR-oH_LFjM#af2}pEI49*D%8yk!vie5;*Xdsi-3yb?b;g}96D$Zm{rmI|w&|SO zub1jga+NvOZXtcYOlG(EEtiA(zkX($|GAL-=3M6Ns;PpjR`}2q`KbqnKe{w8DgV&c z8@J3Jln8E(e^Fu4b=$hnR{6`9J?;EkEM9tD@xS<5-nvWjvWZ6CLG43gZ}esyl-^PI z^bgnD>X+7!4HJcH?%PDOj+$s@q6E=V{)) zE0Zor+V}OkX=CZI&-J06#OYhowRV12rd;TW^bv~5+j{=T(#9e^ zF4?7Lr`zdmdA=#^%9IT(8d@tK=GnA&vz^(Quy&1YP~h%XwvQ2)4l-uXkq~Rq`w?+% z;|rU*D+m6E1s&G0yYz2Cms0t5vobF6D`#6j_3O#H^>;@2#3gKv|1qmdKI;Vst0GihKLjV8( literal 0 HcmV?d00001 diff --git a/Trust/Exchange/Coordinators/ExchangeCoordinator.swift b/Trust/Exchange/Coordinators/ExchangeCoordinator.swift new file mode 100644 index 000000000..1fba5b529 --- /dev/null +++ b/Trust/Exchange/Coordinators/ExchangeCoordinator.swift @@ -0,0 +1,25 @@ +// Copyright SIX DAY LLC. All rights reserved. + +import Foundation +import UIKit + +class ExchangeCoordinator: Coordinator { + + let navigationController: UINavigationController + var rootViewController: UIViewController = { + return ExchangeViewController() + }() + var coordinators: [Coordinator] = [] + + init( + navigationController: UINavigationController = UINavigationController() + ) { + self.navigationController = navigationController + } + + func start() { + navigationController.viewControllers = [ + rootViewController, + ] + } +} diff --git a/Trust/Exchange/ViewConrtrollers/ExchangeViewController.swift b/Trust/Exchange/ViewConrtrollers/ExchangeViewController.swift new file mode 100644 index 000000000..ad0a8a5ac --- /dev/null +++ b/Trust/Exchange/ViewConrtrollers/ExchangeViewController.swift @@ -0,0 +1,8 @@ +// Copyright SIX DAY LLC. All rights reserved. + +import Foundation +import UIKit + +class ExchangeViewController: UIViewController { + +} diff --git a/Trust/InCoordinator.swift b/Trust/InCoordinator.swift index 2df9b4a51..9d56c642d 100644 --- a/Trust/InCoordinator.swift +++ b/Trust/InCoordinator.swift @@ -61,6 +61,14 @@ class InCoordinator: Coordinator { transactionCoordinator.navigationController, tokenCoordinator.navigationController, ] + + if isDebug { + let exchangeCoordinator = ExchangeCoordinator() + exchangeCoordinator.rootViewController.tabBarItem = UITabBarItem(title: "Exchange", image: R.image.exchange(), selectedImage: nil) + exchangeCoordinator.start() + tabBarController.viewControllers?.append(exchangeCoordinator.navigationController) + } + navigationController.setViewControllers( [tabBarController], animated: false