|
|
|
|
@ -14,14 +14,14 @@ class TournamentStats : NSObject, HTMLRepresentable, UITableViewDelegate, UITabl |
|
|
|
|
var entries: Double |
|
|
|
|
var buyin: Double |
|
|
|
|
var prizepool: Double |
|
|
|
|
var itmValue: Double |
|
|
|
|
var firstPrize: Double |
|
|
|
|
|
|
|
|
|
init(entries: Double, buyin: Double, prizepool: Double, itmValue: Double) { |
|
|
|
|
init(entries: Double, buyin: Double, prizepool: Double, firstPrize: Double) { |
|
|
|
|
|
|
|
|
|
self.entries = entries |
|
|
|
|
self.buyin = buyin |
|
|
|
|
self.prizepool = prizepool |
|
|
|
|
self.itmValue = itmValue |
|
|
|
|
self.firstPrize = firstPrize |
|
|
|
|
|
|
|
|
|
super.init() |
|
|
|
|
|
|
|
|
|
@ -45,7 +45,7 @@ class TournamentStats : NSObject, HTMLRepresentable, UITableViewDelegate, UITabl |
|
|
|
|
strings.append(("Entries", NumberFormatter().string(from: NSNumber(value: self.entries))!)) |
|
|
|
|
strings.append(("Buy-in", Formatter.currency.string(from: NSNumber(value: self.buyin))!)) |
|
|
|
|
strings.append(("Prizepool", Formatter.currency.string(from: NSNumber(value: self.prizepool))!)) |
|
|
|
|
strings.append(("Earnings", Formatter.currency.string(from: NSNumber(value: self.itmValue))!)) |
|
|
|
|
strings.append(("Earnings", Formatter.currency.string(from: NSNumber(value: self.firstPrize))!)) |
|
|
|
|
|
|
|
|
|
var all = "" |
|
|
|
|
strings.forEach { (tuple) in |
|
|
|
|
@ -78,7 +78,7 @@ class TournamentStats : NSObject, HTMLRepresentable, UITableViewDelegate, UITabl |
|
|
|
|
case 2: |
|
|
|
|
cells = ("Prizepool", Formatter.currency.string(from: NSNumber(value: self.prizepool))!) |
|
|
|
|
default: |
|
|
|
|
cells = ("Earnings", Formatter.currency.string(from: NSNumber(value: self.itmValue))!) |
|
|
|
|
cells = ("Earnings", Formatter.currency.string(from: NSNumber(value: self.firstPrize))!) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
var leftAnchor = cell.contentView.leftAnchor |
|
|
|
|
@ -125,7 +125,7 @@ class TournamentStats : NSObject, HTMLRepresentable, UITableViewDelegate, UITabl |
|
|
|
|
// MARK: - UICollectionViewDataSource |
|
|
|
|
|
|
|
|
|
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { |
|
|
|
|
return 3 |
|
|
|
|
return 4 |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { |
|
|
|
|
@ -144,8 +144,8 @@ class TournamentStats : NSObject, HTMLRepresentable, UITableViewDelegate, UITabl |
|
|
|
|
name = "Prizepool".uppercased() |
|
|
|
|
value = Formatter.currency.string(from: NSNumber(value: self.prizepool))! |
|
|
|
|
case 3: |
|
|
|
|
name = "Earnings".uppercased() |
|
|
|
|
value = Formatter.currency.string(from: NSNumber(value: self.itmValue))! |
|
|
|
|
name = "First prize".uppercased() |
|
|
|
|
value = Formatter.currency.string(from: NSNumber(value: self.firstPrize))! |
|
|
|
|
default: |
|
|
|
|
name = "" |
|
|
|
|
value = "" |
|
|
|
|
|