Adding RedeemTicketsViewModel

pull/37/head
Oguzhan Gungor 7 years ago
parent 0797d737c9
commit 4a728a3f86
  1. 88
      Trust.xcodeproj/project.pbxproj
  2. 71
      Trust/Redeem/ViewModels/RedeemTicketsViewModel.swift

@ -266,21 +266,29 @@
29FF6D6B2011D2AF00A3011C /* InCoordinatorError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29FF6D6A2011D2AF00A3011C /* InCoordinatorError.swift */; };
29FF6D73201200D500A3011C /* FieldAppereance.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29FF6D72201200D500A3011C /* FieldAppereance.swift */; };
442FC03669B2BB02B0876278 /* StormBirdTokenSummaryTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 442FCFA81968EBB72349E849 /* StormBirdTokenSummaryTableViewCell.swift */; };
442FC0B59B23C0F3068621C0 /* NumberStepper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 442FC575B6A4A50B0555E1B0 /* NumberStepper.swift */; };
442FC11C94F17E8FDC0DA7B7 /* RedeemTickets.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 442FCC6869F8D9EBCE80C1E0 /* RedeemTickets.storyboard */; };
442FC126C8A73F70F2782025 /* TicketDecode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 442FC6911EEE85B669D7BDA1 /* TicketDecode.swift */; };
442FC249C2A39F85BDBD7987 /* GetDecimalsCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 442FC0F2E3BB3EE420BC2C16 /* GetDecimalsCoordinator.swift */; };
442FC258BAEFDE2D64E48D0D /* TicketsCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 442FCC8150042FE9179D574A /* TicketsCoordinator.swift */; };
442FC2CC21FFFC4FAB33A300 /* Ticket.swift in Sources */ = {isa = PBXBuildFile; fileRef = 442FC90F0768C43EF903465B /* Ticket.swift */; };
442FC546ED56F5C9D3D35471 /* TicketRedemptionViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 442FCBDB86579889BC773540 /* TicketRedemptionViewModel.swift */; };
442FC58B7558F28F9452D383 /* GetIsStormBirdCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 442FCEBC98D0A367D258D2C3 /* GetIsStormBirdCoordinator.swift */; };
442FC5F70AF003F331F7C841 /* GetSymbolCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 442FCB2726DB345481C1FDA1 /* GetSymbolCoordinator.swift */; };
442FC65BFA2D42879648EC06 /* Int.swift in Sources */ = {isa = PBXBuildFile; fileRef = 442FCCAC6A172506637A2FF6 /* Int.swift */; };
442FC7777D495D3095836CA6 /* RedeemTicketsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 442FCB2915417EB871E40D6C /* RedeemTicketsViewModel.swift */; };
442FC81F38F80EEF54C69C5B /* TicketAdaptor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 442FC20E6470B92A46479342 /* TicketAdaptor.swift */; };
442FC9C4FAC64192FF5DCC40 /* GetERC20Decimals.swift in Sources */ = {isa = PBXBuildFile; fileRef = 442FC72F9D22CC36AC015274 /* GetERC20Decimals.swift */; };
442FCA2F6C6A21C27B628AA4 /* RedeemTicketTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 442FCD4311FCAFE6FB288A5E /* RedeemTicketTableViewCell.swift */; };
442FCAD7292D93C261B97D09 /* TicketHolder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 442FCFEB2D7443C4E0B889B0 /* TicketHolder.swift */; };
442FCB2B0DD39EB2D9233A2F /* GetStormBirdBalance.swift in Sources */ = {isa = PBXBuildFile; fileRef = 442FC8B1D5B4317DE7D68325 /* GetStormBirdBalance.swift */; };
442FCB9850FC6F2D28978199 /* GETERC20Symbol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 442FCBDD3A69DF75551B10AC /* GETERC20Symbol.swift */; };
442FCB9850FC6F2D28978199 /* GetERC20Symbol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 442FCBDD3A69DF75551B10AC /* GetERC20Symbol.swift */; };
442FCB9CF5BC243F0705F4FE /* TicketRedemptionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 442FCACD2BF4DD90BD9C6DBC /* TicketRedemptionViewController.swift */; };
442FCBBFCC5926B4D416E6D3 /* GetNameCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 442FC630874D29159799EEB6 /* GetNameCoordinator.swift */; };
442FCD76B5C25C9FB7FE7479 /* TicketsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 442FCB182F854B307761CD82 /* TicketsViewModel.swift */; };
442FCE0709E29BF233F32CAB /* GetStormBirdBalanceCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 442FC002CDEA792B8ECD3E13 /* GetStormBirdBalanceCoordinator.swift */; };
442FCE0DAE5527A93F54022C /* QuantitySelectionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 442FCC17EAB857C58732831E /* QuantitySelectionViewController.swift */; };
442FCE2BEE8D475C7DEB39C1 /* QuantitySelectionViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 442FC54DA900FA2F9BB73A63 /* QuantitySelectionViewModel.swift */; };
442FCED8B618930EFD1F7BA8 /* GetIsStormBird.swift in Sources */ = {isa = PBXBuildFile; fileRef = 442FCA1F19B6293FE5FAD494 /* GetIsStormBird.swift */; };
4AEDE35A1DC3B1F4B885A073 /* Pods_AlphaWallet.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9BD60178B937124277D81CCD /* Pods_AlphaWallet.framework */; };
613D04891FDE15F8008DE72E /* COMODO ECC Domain Validation Secure Server CA 2.cer in Resources */ = {isa = PBXBuildFile; fileRef = 613D04881FDE15F8008DE72E /* COMODO ECC Domain Validation Secure Server CA 2.cer */; };
@ -367,8 +375,12 @@
AA26C62620412C9A00318B9B /* ContractStormBirdTransfer.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA26C62520412C9A00318B9B /* ContractStormBirdTransfer.swift */; };
AA26C628204134C500318B9B /* TicketTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA26C627204134C500318B9B /* TicketTableViewCell.swift */; };
AA4E531820425A9500143A09 /* Date.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA4E531720425A9500143A09 /* Date.swift */; };
AA893ED12037E93000CDCED1 /* GETERC20Name.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA893ED02037E93000CDCED1 /* GETERC20Name.swift */; };
AA893ED12037E93000CDCED1 /* GetERC20Name.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA893ED02037E93000CDCED1 /* GetERC20Name.swift */; };
AA893ED5203C3E5400CDCED1 /* TokenBalance.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA893ED4203C3E5400CDCED1 /* TokenBalance.swift */; };
AAEB8DA0204BBDB200CB0B2C /* RadioButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAEB8D9F204BBDB100CB0B2C /* RadioButton.swift */; };
AAEB8DA2204BC7B700CB0B2C /* RedeemTicketsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAEB8DA1204BC7B700CB0B2C /* RedeemTicketsViewController.swift */; };
AAEB8DA6204D5CDE00CB0B2C /* TicketView.xib in Resources */ = {isa = PBXBuildFile; fileRef = AAEB8DA5204D5CDE00CB0B2C /* TicketView.xib */; };
AAEB8DA8204D5CFA00CB0B2C /* TicketView.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAEB8DA7204D5CFA00CB0B2C /* TicketView.swift */; };
B1DC375D203AEAE200C9756D /* OrdersRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1DC375C203AEAE100C9756D /* OrdersRequest.swift */; };
B1DC375F203AEB4800C9756D /* OrderRequestTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1DC375E203AEB4800C9756D /* OrderRequestTest.swift */; };
BB5D6A9E20232EE8000FC5AB /* CurrencyRate+Fee.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB5D6A9D20232EE8000FC5AB /* CurrencyRate+Fee.swift */; };
@ -677,17 +689,25 @@
442FC002CDEA792B8ECD3E13 /* GetStormBirdBalanceCoordinator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GetStormBirdBalanceCoordinator.swift; sourceTree = "<group>"; };
442FC0F2E3BB3EE420BC2C16 /* GetDecimalsCoordinator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GetDecimalsCoordinator.swift; sourceTree = "<group>"; };
442FC20E6470B92A46479342 /* TicketAdaptor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TicketAdaptor.swift; sourceTree = "<group>"; };
442FC54DA900FA2F9BB73A63 /* QuantitySelectionViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = QuantitySelectionViewModel.swift; sourceTree = "<group>"; };
442FC575B6A4A50B0555E1B0 /* NumberStepper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NumberStepper.swift; sourceTree = "<group>"; };
442FC630874D29159799EEB6 /* GetNameCoordinator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GetNameCoordinator.swift; sourceTree = "<group>"; };
442FC6911EEE85B669D7BDA1 /* TicketDecode.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TicketDecode.swift; sourceTree = "<group>"; };
442FC72F9D22CC36AC015274 /* GetERC20Decimals.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GetERC20Decimals.swift; sourceTree = "<group>"; };
442FC8B1D5B4317DE7D68325 /* GetStormBirdBalance.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GetStormBirdBalance.swift; sourceTree = "<group>"; };
442FC90F0768C43EF903465B /* Ticket.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Ticket.swift; sourceTree = "<group>"; };
442FCA1F19B6293FE5FAD494 /* GetIsStormBird.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GetIsStormBird.swift; sourceTree = "<group>"; };
442FCACD2BF4DD90BD9C6DBC /* TicketRedemptionViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TicketRedemptionViewController.swift; sourceTree = "<group>"; };
442FCB182F854B307761CD82 /* TicketsViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TicketsViewModel.swift; sourceTree = "<group>"; };
442FCB2726DB345481C1FDA1 /* GetSymbolCoordinator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GetSymbolCoordinator.swift; sourceTree = "<group>"; };
442FCBDD3A69DF75551B10AC /* GETERC20Symbol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GETERC20Symbol.swift; sourceTree = "<group>"; };
442FCB2915417EB871E40D6C /* RedeemTicketsViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RedeemTicketsViewModel.swift; sourceTree = "<group>"; };
442FCBDB86579889BC773540 /* TicketRedemptionViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TicketRedemptionViewModel.swift; sourceTree = "<group>"; };
442FCBDD3A69DF75551B10AC /* GetERC20Symbol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GetERC20Symbol.swift; sourceTree = "<group>"; };
442FCC17EAB857C58732831E /* QuantitySelectionViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = QuantitySelectionViewController.swift; sourceTree = "<group>"; };
442FCC6869F8D9EBCE80C1E0 /* RedeemTickets.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = RedeemTickets.storyboard; sourceTree = "<group>"; };
442FCC8150042FE9179D574A /* TicketsCoordinator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TicketsCoordinator.swift; sourceTree = "<group>"; };
442FCCAC6A172506637A2FF6 /* Int.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Int.swift; sourceTree = "<group>"; };
442FCD4311FCAFE6FB288A5E /* RedeemTicketTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RedeemTicketTableViewCell.swift; sourceTree = "<group>"; };
442FCEBC98D0A367D258D2C3 /* GetIsStormBirdCoordinator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GetIsStormBirdCoordinator.swift; sourceTree = "<group>"; };
442FCFA81968EBB72349E849 /* StormBirdTokenSummaryTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StormBirdTokenSummaryTableViewCell.swift; sourceTree = "<group>"; };
442FCFEB2D7443C4E0B889B0 /* TicketHolder.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TicketHolder.swift; sourceTree = "<group>"; };
@ -789,8 +809,12 @@
AA26C62520412C9A00318B9B /* ContractStormBirdTransfer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContractStormBirdTransfer.swift; sourceTree = "<group>"; };
AA26C627204134C500318B9B /* TicketTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TicketTableViewCell.swift; sourceTree = "<group>"; };
AA4E531720425A9500143A09 /* Date.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Date.swift; sourceTree = "<group>"; };
AA893ED02037E93000CDCED1 /* GETERC20Name.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GETERC20Name.swift; sourceTree = "<group>"; };
AA893ED02037E93000CDCED1 /* GetERC20Name.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GetERC20Name.swift; sourceTree = "<group>"; };
AA893ED4203C3E5400CDCED1 /* TokenBalance.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TokenBalance.swift; sourceTree = "<group>"; };
AAEB8D9F204BBDB100CB0B2C /* RadioButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RadioButton.swift; sourceTree = "<group>"; };
AAEB8DA1204BC7B700CB0B2C /* RedeemTicketsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RedeemTicketsViewController.swift; sourceTree = "<group>"; };
AAEB8DA5204D5CDE00CB0B2C /* TicketView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = TicketView.xib; sourceTree = "<group>"; };
AAEB8DA7204D5CFA00CB0B2C /* TicketView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TicketView.swift; sourceTree = "<group>"; };
B13A87D3BA5167741E5D0801 /* Pods-Trust.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Trust.release.xcconfig"; path = "Pods/Target Support Files/Pods-Trust/Pods-Trust.release.xcconfig"; sourceTree = "<group>"; };
B1DC375C203AEAE100C9756D /* OrdersRequest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrdersRequest.swift; sourceTree = "<group>"; };
B1DC375E203AEB4800C9756D /* OrderRequestTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderRequestTest.swift; sourceTree = "<group>"; };
@ -1020,9 +1044,9 @@
2963B6BE1F9AB9A2003063C1 /* ContractERC20Transfer.swift */,
AA26C62520412C9A00318B9B /* ContractStormBirdTransfer.swift */,
299B5E281FCA8F040051361C /* GetERC20Balance.swift */,
AA893ED02037E93000CDCED1 /* GETERC20Name.swift */,
AA893ED02037E93000CDCED1 /* GetERC20Name.swift */,
299B5E2A1FCA9A640051361C /* ApproveERC20.swift */,
442FCBDD3A69DF75551B10AC /* GETERC20Symbol.swift */,
442FCBDD3A69DF75551B10AC /* GetERC20Symbol.swift */,
442FC8B1D5B4317DE7D68325 /* GetStormBirdBalance.swift */,
442FCA1F19B6293FE5FAD494 /* GetIsStormBird.swift */,
442FC72F9D22CC36AC015274 /* GetERC20Decimals.swift */,
@ -1073,6 +1097,8 @@
29DBF2A61F9F145900327C60 /* StateViewModel.swift */,
298542E21FBA722F00CB5081 /* ContainerView.swift */,
29DF40091FD3E80A000077CA /* TabBarController.swift */,
AAEB8D9F204BBDB100CB0B2C /* RadioButton.swift */,
442FC575B6A4A50B0555E1B0 /* NumberStepper.swift */,
);
path = UI;
sourceTree = "<group>";
@ -1401,6 +1427,8 @@
29F1C8461FEB6664003780D8 /* EditTokenTableViewCell.xib */,
29F1C84B1FEC4F6F003780D8 /* TokensFooterView.swift */,
442FCFA81968EBB72349E849 /* StormBirdTokenSummaryTableViewCell.swift */,
AAEB8DA5204D5CDE00CB0B2C /* TicketView.xib */,
AAEB8DA7204D5CFA00CB0B2C /* TicketView.swift */,
);
path = Views;
sourceTree = "<group>";
@ -1950,6 +1978,35 @@
path = Coordinators;
sourceTree = "<group>";
};
442FC515DE27FF45AB993345 /* Views */ = {
isa = PBXGroup;
children = (
442FCD4311FCAFE6FB288A5E /* RedeemTicketTableViewCell.swift */,
);
path = Views;
sourceTree = "<group>";
};
442FC5CFFC1E1126C7E6C682 /* ViewModels */ = {
isa = PBXGroup;
children = (
442FCB2915417EB871E40D6C /* RedeemTicketsViewModel.swift */,
442FC54DA900FA2F9BB73A63 /* QuantitySelectionViewModel.swift */,
442FCBDB86579889BC773540 /* TicketRedemptionViewModel.swift */,
);
path = ViewModels;
sourceTree = "<group>";
};
442FC7C7CCBFDDE6B395C64B /* ViewControllers */ = {
isa = PBXGroup;
children = (
AAEB8DA1204BC7B700CB0B2C /* RedeemTicketsViewController.swift */,
442FCC6869F8D9EBCE80C1E0 /* RedeemTickets.storyboard */,
442FCC17EAB857C58732831E /* QuantitySelectionViewController.swift */,
442FCACD2BF4DD90BD9C6DBC /* TicketRedemptionViewController.swift */,
);
path = ViewControllers;
sourceTree = "<group>";
};
442FCB1A0F74A68425907AC9 /* Helpers */ = {
isa = PBXGroup;
children = (
@ -2066,6 +2123,9 @@
isa = PBXGroup;
children = (
76F1DF80932454E9F58B7830 /* CreateRedeem.swift */,
442FC7C7CCBFDDE6B395C64B /* ViewControllers */,
442FC5CFFC1E1126C7E6C682 /* ViewModels */,
442FC515DE27FF45AB993345 /* Views */,
);
path = Redeem;
sourceTree = "<group>";
@ -2435,6 +2495,7 @@
C876FF85204A79D300B7D0EA /* SourceSansPro-Semibold.otf in Resources */,
613D04891FDE15F8008DE72E /* COMODO ECC Domain Validation Secure Server CA 2.cer in Resources */,
C876FF7D204A79D300B7D0EA /* SourceSansPro-Bold.otf in Resources */,
AAEB8DA6204D5CDE00CB0B2C /* TicketView.xib in Resources */,
29FA00D2201CA79F002F7DC5 /* web3.min.js in Resources */,
771AA966200D5F1900D25403 /* WordCollectionViewCell.xib in Resources */,
291794FC1F95DE5F00539A30 /* index.html in Resources */,
@ -2446,6 +2507,7 @@
2912CD021F6A830700C6CBE3 /* Assets.xcassets in Resources */,
73CBC75F2020CBF800374666 /* AccountViewCell.xib in Resources */,
29F1C8481FEB6664003780D8 /* EditTokenTableViewCell.xib in Resources */,
442FC11C94F17E8FDC0DA7B7 /* RedeemTickets.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -2741,7 +2803,7 @@
AA26C62320412A4100318B9B /* UIViewInspectableEnhancements.swift in Sources */,
290B2B651F91A4880053C83E /* TransactionsFooterView.swift in Sources */,
293B8B431F70815900356286 /* BalanceTitleView.swift in Sources */,
AA893ED12037E93000CDCED1 /* GETERC20Name.swift in Sources */,
AA893ED12037E93000CDCED1 /* GetERC20Name.swift in Sources */,
29DBF2A11F9DA6EF00327C60 /* BackupViewController.swift in Sources */,
29FC9BC61F830899000209CD /* MirgrationInitializer.swift in Sources */,
29AD8A091F93F8B2008E10E7 /* Session.swift in Sources */,
@ -2820,6 +2882,7 @@
291EC9DF1F7053C50004EDD0 /* NavigationController.swift in Sources */,
291795011F95F5E200539A30 /* GetBalance.swift in Sources */,
2995739F1FA1F294006F17FD /* QRURLParser.swift in Sources */,
AAEB8DA0204BBDB200CB0B2C /* RadioButton.swift in Sources */,
29C9F5F91F720BD30025C494 /* FloatLabelCell.swift in Sources */,
771AA960200D5E8800D25403 /* PassphraseView.swift in Sources */,
7721A6BE202A5677004DB16C /* DecryptError.swift in Sources */,
@ -2897,7 +2960,9 @@
615F10621FCD3F0F008A45AF /* OnboardingPageStyle.swift in Sources */,
2912CD341F6A849C00C6CBE3 /* WelcomeViewModel.swift in Sources */,
7721A6C8202EF81B004DB16C /* CustomRPC.swift in Sources */,
AAEB8DA8204D5CFA00CB0B2C /* TicketView.swift in Sources */,
29E9CFCD1FE7343C00017744 /* NewTokenViewModel.swift in Sources */,
AAEB8DA2204BC7B700CB0B2C /* RedeemTicketsViewController.swift in Sources */,
291F52A21F6B6DCF00B369AB /* EtherClient.swift in Sources */,
299B5E421FD2298E0051361C /* ConfigureTransactionViewController.swift in Sources */,
294DFBA31FE0E2EA004CEB56 /* TransactionValue.swift in Sources */,
@ -2986,7 +3051,7 @@
29F1C83E1FEB5C91003780D8 /* EditTokensViewController.swift in Sources */,
296AF9A31F733AB30058AF78 /* WalletCoordinator.swift in Sources */,
442FCBBFCC5926B4D416E6D3 /* GetNameCoordinator.swift in Sources */,
442FCB9850FC6F2D28978199 /* GETERC20Symbol.swift in Sources */,
442FCB9850FC6F2D28978199 /* GetERC20Symbol.swift in Sources */,
442FC5F70AF003F331F7C841 /* GetSymbolCoordinator.swift in Sources */,
442FCB2B0DD39EB2D9233A2F /* GetStormBirdBalance.swift in Sources */,
442FCE0709E29BF233F32CAB /* GetStormBirdBalanceCoordinator.swift in Sources */,
@ -3004,6 +3069,13 @@
442FC03669B2BB02B0876278 /* StormBirdTokenSummaryTableViewCell.swift in Sources */,
442FC258BAEFDE2D64E48D0D /* TicketsCoordinator.swift in Sources */,
76F1D91659771C9EEA7B48DC /* CreateRedeem.swift in Sources */,
442FCA2F6C6A21C27B628AA4 /* RedeemTicketTableViewCell.swift in Sources */,
442FC7777D495D3095836CA6 /* RedeemTicketsViewModel.swift in Sources */,
442FCE0DAE5527A93F54022C /* QuantitySelectionViewController.swift in Sources */,
442FC0B59B23C0F3068621C0 /* NumberStepper.swift in Sources */,
442FCE2BEE8D475C7DEB39C1 /* QuantitySelectionViewModel.swift in Sources */,
442FCB9CF5BC243F0705F4FE /* TicketRedemptionViewController.swift in Sources */,
442FC546ED56F5C9D3D35471 /* TicketRedemptionViewModel.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};

@ -0,0 +1,71 @@
//
// RedeemTicketsViewModel.swift
// Alpha-Wallet
//
// Created by Oguzhan Gungor on 3/4/18.
// Copyright © 2018 Alpha-Wallet. All rights reserved.
//
import Foundation
import UIKit
struct RedeemTicketsViewModel {
var token: TokenObject
var ticketHolders: [TicketHolder]?
init(token: TokenObject) {
self.token = token
self.ticketHolders = TicketAdaptor.getTicketHolders(for: token)
}
func item(for indexPath: IndexPath) -> TicketHolder {
return ticketHolders![indexPath.row]
}
func cell(for tableView: UITableView, indexPath: IndexPath) -> UITableViewCell {
if indexPath.section == 0 {
return summaryCell(for: tableView, indexPath: indexPath)
}
return ticketCell(for: tableView, indexPath: indexPath)
}
var numberOfSections: Int {
return 2
}
func numberOfItems(for section: Int) -> Int {
if section == 0 {
return 1
}
return ticketHolders!.count
}
func height(for section: Int) -> CGFloat {
if section == 0 {
return 30
}
return 90
}
var title: String {
return "Redeem Asset"
}
func ticketCellPressed(for indexPath: IndexPath) -> Bool {
return indexPath.section == 1
}
private func summaryCell(for tableView: UITableView, indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: R.reuseIdentifier.redeemTableViewCell, for: indexPath)
return cell!
}
private func ticketCell(for tableView: UITableView, indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: R.reuseIdentifier.redeemTicketCell, for: indexPath)!
let ticketHolder = item(for: indexPath)
cell.configure(ticketHolder: ticketHolder)
return cell
}
}
Loading…
Cancel
Save