More let(s), less var(s) during token flows

pull/617/head
Hwee-Boon Yar 6 years ago
parent ca96e3b13d
commit a5f73967f4
  1. 2
      AlphaWallet/Redeem/ViewControllers/RedeemTokenCardQuantitySelectionViewController.swift
  2. 4
      AlphaWallet/Sell/ViewControllers/EnterSellTokensCardPriceQuantityViewController.swift
  3. 8
      AlphaWallet/Sell/ViewControllers/GenerateSellMagicLinkViewController.swift
  4. 2
      AlphaWallet/Sell/ViewControllers/SellTokensCardViewController.swift
  5. 10
      AlphaWallet/Sell/ViewControllers/SetSellTokensCardExpiryDateViewController.swift
  6. 6
      AlphaWallet/Sell/ViewModels/GenerateSellMagicLinkViewControllerViewModel.swift
  7. 6
      AlphaWallet/Tokens/ViewControllers/TokensCardViewController.swift
  8. 14
      AlphaWallet/Transfer/Coordinators/TransferNFTCoordinator.swift
  9. 4
      AlphaWallet/Transfer/ViewControllers/ChooseTokenCardTransferModeViewController.swift
  10. 6
      AlphaWallet/Transfer/ViewControllers/GenerateTransferMagicLinkViewController.swift
  11. 8
      AlphaWallet/Transfer/ViewControllers/SetTransferTokensCardExpiryDateViewController.swift
  12. 4
      AlphaWallet/Transfer/ViewControllers/TransferTokensCardQuantitySelectionViewController.swift

@ -24,7 +24,7 @@ class RedeemTokenCardQuantitySelectionViewController: UIViewController, TicketVe
let roundedBackground = RoundedBackground()
let header = TokensCardViewControllerTitleHeader()
let subtitleLabel = UILabel()
var quantityStepper = NumberStepper()
let quantityStepper = NumberStepper()
let ticketView: TokenRowView & UIView
let nextButton = UIButton(type: .system)
var viewModel: RedeemTokenCardQuantitySelectionViewModel

@ -30,8 +30,8 @@ class EnterSellTokensCardPriceQuantityViewController: UIViewController, TicketVe
let ticketView: TokenRowView & UIView
let nextButton = UIButton(type: .system)
var viewModel: EnterSellTokensCardPriceQuantityViewControllerViewModel
var paymentFlow: PaymentFlow
var ethPrice: Subscribable<Double>
let paymentFlow: PaymentFlow
let ethPrice: Subscribable<Double>
var totalEthCost: Ether {
if let ethCostPerTicket = Ether(string: pricePerTicketField.ethCost) {
let quantity = Int(quantityStepper.value)

@ -20,10 +20,10 @@ class GenerateSellMagicLinkViewController: UIViewController {
let descriptionLabel = UILabel()
let actionButton = UIButton()
let cancelButton = UIButton()
var paymentFlow: PaymentFlow
var ticketHolder: TokenHolder
var ethCost: Ether
var linkExpiryDate: Date
let paymentFlow: PaymentFlow
let ticketHolder: TokenHolder
let ethCost: Ether
let linkExpiryDate: Date
var viewModel: GenerateSellMagicLinkViewControllerViewModel?
init(paymentFlow: PaymentFlow, ticketHolder: TokenHolder, ethCost: Ether, linkExpiryDate: Date) {

@ -20,7 +20,7 @@ class SellTokensCardViewController: UIViewController, TicketVerifiableStatusView
let tableView = UITableView(frame: .zero, style: .plain)
let nextButton = UIButton(type: .system)
var viewModel: SellTokensCardViewModel
var paymentFlow: PaymentFlow
let paymentFlow: PaymentFlow
weak var delegate: SellTokensCardViewControllerDelegate?
init(config: Config, paymentFlow: PaymentFlow, viewModel: SellTokensCardViewModel) {

@ -31,12 +31,12 @@ class SetSellTokensCardExpiryDateViewController: UIViewController, TicketVerifia
let noteBorderView = UIView()
let ticketView: TokenRowView & UIView
let nextButton = UIButton(type: .system)
var datePicker = UIDatePicker()
var timePicker = UIDatePicker()
let datePicker = UIDatePicker()
let timePicker = UIDatePicker()
var viewModel: SetSellTokensCardExpiryDateViewControllerViewModel
var paymentFlow: PaymentFlow
var ticketHolder: TokenHolder
var ethCost: Ether
let paymentFlow: PaymentFlow
let ticketHolder: TokenHolder
let ethCost: Ether
weak var delegate: SetSellTokensCardExpiryDateViewControllerDelegate?
init(

@ -3,9 +3,9 @@
import UIKit
struct GenerateSellMagicLinkViewControllerViewModel {
var ticketHolder: TokenHolder
var ethCost: Ether
var linkExpiryDate: Date
let ticketHolder: TokenHolder
let ethCost: Ether
let linkExpiryDate: Date
var contentsBackgroundColor: UIColor {
return Colors.appWhite

@ -29,9 +29,9 @@ class TokensCardViewController: UIViewController, TicketVerifiableStatusViewCont
}
var tokenObject: TokenObject
var viewModel: TicketsViewModel
var tokensStorage: TokensDataStore
var account: Wallet
var session: WalletSession
let tokensStorage: TokensDataStore
let account: Wallet
let session: WalletSession
weak var delegate: TokensCardViewControllerDelegate?
let header = TicketsViewControllerHeader()
let roundedBackground = RoundedBackground()

@ -12,13 +12,13 @@ protocol TransferNFTCoordinatorDelegate: class {
class TransferNFTCoordinator: Coordinator {
var coordinators: [Coordinator] = []
var ticketHolder: TokenHolder
var walletAddress: String
var paymentFlow: PaymentFlow
var keystore: Keystore
var session: WalletSession
var account: Account
var viewController: UIViewController
let ticketHolder: TokenHolder
let walletAddress: String
let paymentFlow: PaymentFlow
let keystore: Keystore
let session: WalletSession
let account: Account
let viewController: UIViewController
var statusViewController: StatusViewController?
weak var delegate: TransferNFTCoordinatorDelegate?
var status = StatusViewControllerViewModel.State.processing {

@ -22,8 +22,8 @@ class ChooseTokenCardTransferModeViewController: UIViewController, TicketVerifia
let generateMagicLinkButton = UIButton(type: .system)
let transferNowButton = UIButton(type: .system)
var viewModel: ChooseTokenCardTransferModeViewControllerViewModel
var ticketHolder: TokenHolder
var paymentFlow: PaymentFlow
let ticketHolder: TokenHolder
let paymentFlow: PaymentFlow
weak var delegate: ChooseTokenCardTransferModeViewControllerDelegate?
init(

@ -18,9 +18,9 @@ class GenerateTransferMagicLinkViewController: UIViewController {
let descriptionLabel = UILabel()
let actionButton = UIButton()
let cancelButton = UIButton()
var paymentFlow: PaymentFlow
var ticketHolder: TokenHolder
var linkExpiryDate: Date
let paymentFlow: PaymentFlow
let ticketHolder: TokenHolder
let linkExpiryDate: Date
var viewModel: GenerateTransferMagicLinkViewControllerViewModel?
init(paymentFlow: PaymentFlow, ticketHolder: TokenHolder, linkExpiryDate: Date) {

@ -22,16 +22,16 @@ class SetTransferTokensCardExpiryDateViewController: UIViewController, TicketVer
let linkExpiryDateField = DateEntryField()
let linkExpiryTimeLabel = UILabel()
let linkExpiryTimeField = TimeEntryField()
var datePicker = UIDatePicker()
var timePicker = UIDatePicker()
let datePicker = UIDatePicker()
let timePicker = UIDatePicker()
let descriptionLabel = UILabel()
let noteTitleLabel = UILabel()
let noteLabel = UILabel()
let noteBorderView = UIView()
let nextButton = UIButton(type: .system)
var viewModel: SetTransferTokensCardExpiryDateViewControllerViewModel
var ticketHolder: TokenHolder
var paymentFlow: PaymentFlow
let ticketHolder: TokenHolder
let paymentFlow: PaymentFlow
weak var delegate: SetTransferTokensCardExpiryDateViewControllerDelegate?
init(

@ -17,11 +17,11 @@ class TransferTokensCardQuantitySelectionViewController: UIViewController, Ticke
let roundedBackground = RoundedBackground()
let header = TokensCardViewControllerTitleHeader()
let subtitleLabel = UILabel()
var quantityStepper = NumberStepper()
let quantityStepper = NumberStepper()
let ticketView: TokenRowView & UIView
let nextButton = UIButton(type: .system)
var viewModel: TransferTokensCardQuantitySelectionViewModel
var paymentFlow: PaymentFlow
let paymentFlow: PaymentFlow
private let token: TokenObject
weak var delegate: TransferTokenCardQuantitySelectionViewControllerDelegate?

Loading…
Cancel
Save