Created
January 28, 2019 07:05
-
-
Save buddies2705/89cd05d90d5fda3ac8532db2f99b3e1c to your computer and use it in GitHub Desktop.
ListTableViewController
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ListTableViewController: UITableViewController { | |
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { | |
if let cell = tableView.dequeueReusableCell(withIdentifier: "DataTableViewCell", for: indexPath) as? DataTableViewCell { | |
var koinObject : KoinModel? | |
if(self.currentIndex == 0){ | |
koinObject = appDelegateObj().finalModelObject?.inrList[indexPath.row] | |
cell.iconImageView.image = UIImage(named: "rupees") | |
} | |
else if(self.currentIndex == 1){ | |
koinObject = appDelegateObj().finalModelObject?.bitcoinList[indexPath.row] | |
cell.iconImageView.image = UIImage(named: "bitcoin") | |
} | |
else if(self.currentIndex == 2){ | |
koinObject = appDelegateObj().finalModelObject?.etherList[indexPath.row] | |
cell.iconImageView.image = UIImage(named: "ether") | |
} | |
else{ | |
koinObject = appDelegateObj().finalModelObject?.rippleList[indexPath.row] | |
cell.iconImageView.image = UIImage(named: "ripple") | |
} | |
cell.nameLabel.text = koinObject?.currencyFullForm?.capitalized | |
cell.name.text = koinObject?.currencyShortForm | |
cell.priceLabel.text = koinObject?.lastTradedPrice | |
cell.higherPrice.text = koinObject?.highestBid | |
cell.lowerPrice.text = koinObject?.lowestAsk | |
cell.selectionStyle = .none | |
return cell | |
} | |
return UITableViewCell() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment