Skip to content

Commit

Permalink
code arraging
Browse files Browse the repository at this point in the history
  • Loading branch information
yangjehpark committed Mar 2, 2017
1 parent c2810ce commit df724b7
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 14 deletions.
4 changes: 0 additions & 4 deletions YahooFinance/QuoteTableViewCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,4 @@ class QuoteTableViewCell: UITableViewCell {
@IBOutlet var keyLabel:UILabel!
@IBOutlet var valueLabel:UILabel!

func configure(index: Int, quote: Quote) {
self.valueLabel.text = String(describing: Array(quote.toJSON().values)[index])
self.keyLabel.text = Array(quote.toJSON().keys)[index]
}
}
6 changes: 1 addition & 5 deletions YahooFinance/QuoteTableViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,7 @@ class QuoteTableViewController: YahooFinanceViewController {
}

func showQuoteTableView() {
var contents = [(String, Any)]()
for content in self.viewModel.quotes[0].toJSON() {
contents.append(content)
}
let quotesContents = Variable(contents)
let quotesContents = Variable(self.viewModel.quotes[0].toJSON())
quotesContents.asObservable().bindTo(self.quoteTableView.rx.items(cellIdentifier: QuoteTableViewCell.reuseIdentifier, cellType: QuoteTableViewCell.self)) { (row, element, cell) in
cell.keyLabel.text = element.0
cell.valueLabel.text = String(describing: element.1)
Expand Down
6 changes: 1 addition & 5 deletions YahooFinance/SymbolTableViewCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,5 @@ class SymbolTableViewCell: UITableViewCell {

@IBOutlet var nameLabel:UILabel!
@IBOutlet var symbolLabel:UILabel!

func configure(result: Result) {
self.nameLabel.text = (result.name ?? "")
self.symbolLabel.text = (result.symbol ?? "")
}

}

0 comments on commit df724b7

Please sign in to comment.