Skip to content

Instantly share code, notes, and snippets.

@isaac-weisberg
Created April 13, 2021 21:05
Show Gist options
  • Select an option

  • Save isaac-weisberg/b66d1f961e7d0b291cd4e028c8086908 to your computer and use it in GitHub Desktop.

Select an option

Save isaac-weisberg/b66d1f961e7d0b291cd4e028c8086908 to your computer and use it in GitHub Desktop.

Revisions

  1. isaac-weisberg created this gist Apr 13, 2021.
    18 changes: 18 additions & 0 deletions SUSTableView-Proper.swift
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    class TransactionTable: CustomTableView {
    override init(viewModel: TransactionTableViewModel) {
    super.init()

    viewModel.transactionViewModels.forEach { transactionViewModel in
    switch transactionViewModel {
    case .info(let viewModel):
    let cell = TransactionInfoCell(viewModel: viewModel)

    self.addCell(cell)
    case .infoPendingAccept(let viewModel):
    let cell = TransactionInfoWAcceptCell(viewModel: viewModel)

    self.addCell(cell)
    }
    }
    }
    }