Layout improvements

master
Laurent 6 years ago
parent 25890809d6
commit 3705fdeb08
  1. 9
      TournamentStats/AppDelegate.swift
  2. 13
      TournamentStats/UI/Fonts.swift
  3. 2
      TournamentStats/UI/StackTableCell.swift
  4. 7
      TournamentStats/UI/components/DataSourceWrapper.swift
  5. 7
      TournamentStats/UI/components/PieChart.swift
  6. 2
      TournamentStats/UI/components/TableView.swift
  7. 36
      TournamentStats/UI/reports/InfographyView.swift
  8. 112
      TournamentStats/UI/reports/InfographyView.xib
  9. 7
      TournamentStats/UI/reports/StatCollectionViewCell.swift
  10. 4
      TournamentStats/UI/reports/StatCollectionViewCell.xib
  11. 8
      TournamentStats/report/Queries.swift
  12. 6
      TournamentStats/report/structures/FestivalStats.swift
  13. 4
      TournamentStats/report/structures/TournamentRepresentable.swift
  14. 8
      TournamentStats/report/structures/TournamentStats.swift

@ -18,6 +18,15 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDele
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
for fontFamilyName in UIFont.familyNames {
print("family: \(fontFamilyName)\n")
for fontName in UIFont.fontNames(forFamilyName: fontFamilyName) {
print("font: \(fontName)")
}
}
// UI stuff
let splitViewController = window!.rootViewController as! UISplitViewController
let navigationController = splitViewController.viewControllers[splitViewController.viewControllers.count-1] as! UINavigationController

@ -11,9 +11,14 @@ import UIKit
class Fonts {
static let mainTitle: UIFont = UIFont.systemFont(ofSize: 64.0)
static let subTitle: UIFont = UIFont.systemFont(ofSize: 24.0)
static let pieChartEntries: UIFont = UIFont.boldSystemFont(ofSize: 28)
static let chartLegend: UIFont = UIFont.systemFont(ofSize: 18.0)
static let monospaced: UIFont = UIFont(name: "Menlo-Regular", size: 18.0)! // UIFont.systemFont(ofSize: 18.0)
static let bigNumbers: UIFont = UIFont(name: "Menlo-Regular", size: 48.0)!
static let regular: UIFont = UIFont(name: "Menlo-Regular", size: 18.0)! // UIFont.systemFont(ofSize: 18.0)
static let bold: UIFont = UIFont(name: "Menlo-Bold", size: 18.0)! // UIFont.systemFont(ofSize: 18.0)
static let mainTitle: UIFont = UIFont(name: "Menlo-Regular", size: 72.0)! //UIFont.systemFont(ofSize: 72.0)
static let subTitle: UIFont = UIFont(name: "Menlo-Regular", size: 28.0)! //UIFont.systemFont(ofSize: 24.0)
static let pieChartEntries: UIFont = UIFont(name: "Menlo-Bold", size: 28.0)! //UIFont.boldSystemFont(ofSize: 28)
static let chartLegend: UIFont = UIFont(name: "Menlo-Regular", size: 18.0)! // UIFont.systemFont(ofSize: 18.0)
}

@ -9,7 +9,7 @@
import Foundation
import UIKit
class StackTableCell: UITableViewCell {
class StackTableCell : UITableViewCell {
@IBOutlet weak var stackView: UIStackView!

@ -51,13 +51,13 @@ class DataSourceWrapper<T : ColumnRepresentable> : NSObject, UITableViewDataSour
cells = cr.cellValues()
}
var font: UIFont = UIFont.boldSystemFont(ofSize: FONTSIZE)
var font: UIFont = Fonts.bold
var leftAnchor = cell.contentView.leftAnchor
for (index, value) in cells.enumerated() {
if (indexPath.row > 0) {
font = self.columnDescriptors[index].number ? UIFont.monospacedDigitSystemFont(ofSize: FONTSIZE, weight: UIFont.Weight.regular) : UIFont.systemFont(ofSize: FONTSIZE)
font = self.columnDescriptors[index].number ? Fonts.monospaced : Fonts.regular
}
let labelContainer: UIView = UIView()
@ -69,7 +69,8 @@ class DataSourceWrapper<T : ColumnRepresentable> : NSObject, UITableViewDataSour
labelContainer.leftAnchor.constraint(equalTo: leftAnchor, constant: leftPadding).isActive = true
leftAnchor = labelContainer.rightAnchor
labelContainer.backgroundColor = index.isMultiple(of: 2) ? UIColor.clear : UIColor(white: 0.9, alpha: 0.1)
// labelContainer.backgroundColor = index.isMultiple(of: 2) ? UIColor.clear : UIColor(white: 0.9, alpha: 0.1)
labelContainer.backgroundColor = UIColor.clear
let multiplier: CGFloat = self.columnDescriptors[index].widthWeight / self.totalWidthWeigth
labelContainer.widthAnchor.constraint(equalTo: cell.contentView.widthAnchor, multiplier: multiplier).isActive = true

@ -14,11 +14,14 @@ class PieChart : PieChartView {
override init(frame: CGRect) {
super.init(frame: frame)
self.backgroundColor = UIColor.gray
self.holeColor = UIColor.clear
self.usePercentValuesEnabled = true
self.minOffset = 16.0
self.holeRadiusPercent = 0
self.drawEntryLabelsEnabled = false
self.transparentCircleRadiusPercent = 0
self.legend.textColor = UIColor.white
self.legend.font = Fonts.chartLegend
@ -27,8 +30,8 @@ class PieChart : PieChartView {
// self.legend.neededHeight = 203.0
// self.legend.neededWidth = 300.0
// self.legend.maxSizePercent = 30
// self.legend.horizontalAlignment = .left
self.legend.verticalAlignment = .bottom
self.legend.horizontalAlignment = .left
self.legend.verticalAlignment = .top
self.legend.drawInside = false
// self.legend.yOffset = -30.0
// self.legend.xOffset = 10.0

@ -28,11 +28,13 @@ class TableView : UITableView {
label.textColor = UIColor.white
label.backgroundColor = UIColor.clear
label.textAlignment = .center
label.font = Fonts.regular
return label
}
func setHeader(header: String) {
let label = self.label(height: 60.0, text: header)
label.textAlignment = .left
label.font = Fonts.subTitle
self.tableHeaderView = label
}

@ -104,23 +104,22 @@ class InfographyView: UIView {
/////
// self.label11.text = "Biggest Winners".uppercased()
self.label12.text = "Most Cashes".uppercased()
self.label13.text = "Best average cash (7+)".uppercased()
self.tableView11.setData(data: generator.biggestWinners)
self.tableView11.setHeader(header: "Biggest Winners")
self.tableView11.setFooter(footer: "* denotes a Main Event finalist")
self.tableView12.setData(data: generator.mostCashes, maxRows: 5)
self.tableView12.setHeader(header: "Most Cashes")
self.tableView13.setData(data: generator.averageCash, maxRows: 5)
self.tableView13.setHeader(header: "Best average cash (7+)")
/////
self.label21.text = "Buy-in distribution".uppercased()
self.label22.text = "First prizes distribution".uppercased()
self.label23.text = "Prizepool distribution".uppercased()
self.label21.text = "Buy-in distribution"
self.label22.text = "First prizes distribution"
// self.label23.text = "Prizepool distribution".uppercased()
let pieChartFrame = CGRect(x: 0, y: 0, width: 500, height: 500)
let pieChartFrame = CGRect(x: 0, y: 0, width: 650, height: 500)
let buyinDistribPie = PieChart(frame: pieChartFrame)
buyinDistribPie.data = generator.tournamentBuyinDistribution.pieChartData
self.container21.addSubview(buyinDistribPie)
@ -129,34 +128,33 @@ class InfographyView: UIView {
firstPrizeDistributionPie.data = generator.firstPrizeDistribution.pieChartData
self.container22.addSubview(firstPrizeDistributionPie)
let prizepoolDistribPie = PieChart(frame: pieChartFrame)
prizepoolDistribPie.data = generator.tournamentPrizepoolDistribution.pieChartData
self.container23.addSubview(prizepoolDistribPie)
// let prizepoolDistribPie = PieChart(frame: pieChartFrame)
// prizepoolDistribPie.data = generator.tournamentPrizepoolDistribution.pieChartData
// self.container23.addSubview(prizepoolDistribPie)
/////
// self.label31.text = "Events by prizepool".uppercased()
// self.label32.text = "Events by entries".uppercased()
self.tableView31.setHeader(header: "Events by prizepool".uppercased())
self.tableView31.setHeader(header: "Events by prizepool")
self.tableView31.setData(data: generator.tourniesByPrizepool, maxRows: 5)
self.tableView32.setHeader(header: "Events by entries".uppercased())
self.tableView32.setHeader(header: "Events by entries")
self.tableView32.setData(data: generator.tourniesByEntries, maxRows: 5)
/////
self.label41.text = "USA vs World bracelets".uppercased()
self.label42.text = "Hold'em vs not hold'em".uppercased()
self.label41.text = "USA vs World bracelets"
self.label42.text = "Hold'em vs not Hold'em"
let USABraceletsDistribPie = PieChart(frame: pieChartFrame)
USABraceletsDistribPie.data = generator.USAvsWorldWins.pieChartData
self.container41.addSubview(USABraceletsDistribPie)
self.container41.addMaxConstraints(view: USABraceletsDistribPie)
let holdemDistributionPie = PieChart(frame: pieChartFrame)
holdemDistributionPie.data = generator.holdemTournamentsDistribution.pieChartData
self.container42.addSubview(holdemDistributionPie)
self.container42.addMaxConstraints(view: holdemDistributionPie)
self.label51.text = "Average Event".uppercased()
self.label51.text = "Average WSOP 2019 Event".uppercased()
let ds = generator.averageEvent.first
self.collectionView51.register(UINib(nibName: "StatCollectionViewCell", bundle: Bundle.main), forCellWithReuseIdentifier: "Stat")
self.collectionView51.dataSource = ds

@ -17,7 +17,7 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="w79-xx-Evx">
<rect key="frame" x="100" y="44" width="1300" height="3370"/>
<rect key="frame" x="100" y="44" width="1300" height="3410"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="2019 WSOP" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="4Hu-Ou-nFd">
<rect key="frame" x="0.0" y="0.0" width="1300" height="100"/>
@ -36,11 +36,11 @@
</constraints>
<viewLayoutGuide key="safeArea" id="cgF-JL-ieX"/>
</view>
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" spacing="16" translatesAutoresizingMaskIntoConstraints="NO" id="ABP-ce-MDa">
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillProportionally" spacing="16" translatesAutoresizingMaskIntoConstraints="NO" id="ABP-ce-MDa">
<rect key="frame" x="0.0" y="170" width="1300" height="500"/>
<subviews>
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" contentInsetAdjustmentBehavior="always" dataMode="none" translatesAutoresizingMaskIntoConstraints="NO" id="Vh3-97-zuO">
<rect key="frame" x="0.0" y="0.0" width="642" height="500"/>
<rect key="frame" x="0.0" y="0.0" width="571.5" height="500"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<inset key="scrollIndicatorInsets" minX="0.0" minY="40" maxX="0.0" maxY="0.0"/>
<collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="10" minimumInteritemSpacing="10" sectionInsetReference="safeArea" id="O06-sl-CBC">
@ -51,9 +51,13 @@
</collectionViewFlowLayout>
</collectionView>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="grouped" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="18" sectionFooterHeight="18" translatesAutoresizingMaskIntoConstraints="NO" id="HbR-TC-HeD" customClass="TableView" customModule="TournamentStats" customModuleProvider="target">
<rect key="frame" x="658" y="0.0" width="642" height="500"/>
<rect key="frame" x="587.5" y="0.0" width="572" height="500"/>
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
</tableView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="IqT-2X-roS">
<rect key="frame" x="1175.5" y="0.0" width="124.5" height="500"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</view>
</subviews>
<constraints>
<constraint firstAttribute="height" constant="500" id="LQg-JD-2Lr"/>
@ -67,28 +71,8 @@
</constraints>
<viewLayoutGuide key="safeArea" id="x7x-j2-Rbi"/>
</view>
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillProportionally" translatesAutoresizingMaskIntoConstraints="NO" id="Vf4-JJ-wEt">
<rect key="frame" x="0.0" y="740" width="1300" height="50"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="VWQ-ZA-7rt" customClass="Label" customModule="TournamentStats" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="650" height="50"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="iaM-v8-HTO" customClass="Label" customModule="TournamentStats" customModuleProvider="target">
<rect key="frame" x="650" y="0.0" width="650" height="50"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstAttribute="height" constant="50" id="Ump-tg-4hL"/>
</constraints>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" spacing="50" translatesAutoresizingMaskIntoConstraints="NO" id="NbO-FE-SHj">
<rect key="frame" x="0.0" y="800" width="1300" height="300"/>
<rect key="frame" x="0.0" y="740" width="1300" height="300"/>
<subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="grouped" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="18" sectionFooterHeight="18" translatesAutoresizingMaskIntoConstraints="NO" id="M2m-xf-le9" customClass="TableView" customModule="TournamentStats" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="625" height="300"/>
@ -104,22 +88,16 @@
</constraints>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillProportionally" translatesAutoresizingMaskIntoConstraints="NO" id="91U-hc-Oqn">
<rect key="frame" x="0.0" y="1110" width="1300" height="40"/>
<rect key="frame" x="0.0" y="1050" width="1300" height="40"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Hcr-dr-rUz" customClass="Label" customModule="TournamentStats" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="433.5" height="40"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="2yf-Z5-Tpy" customClass="Label" customModule="TournamentStats" customModuleProvider="target">
<rect key="frame" x="433.5" y="0.0" width="433" height="40"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Hcr-dr-rUz" customClass="Label" customModule="TournamentStats" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="650" height="40"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="hcG-kJ-HS1" customClass="Label" customModule="TournamentStats" customModuleProvider="target">
<rect key="frame" x="866.5" y="0.0" width="433.5" height="40"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="2yf-Z5-Tpy" customClass="Label" customModule="TournamentStats" customModuleProvider="target">
<rect key="frame" x="650" y="0.0" width="650" height="40"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
@ -130,27 +108,31 @@
</constraints>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" spacing="16" translatesAutoresizingMaskIntoConstraints="NO" id="4u9-3E-Qwu">
<rect key="frame" x="0.0" y="1160" width="1300" height="500"/>
<rect key="frame" x="0.0" y="1100" width="1300" height="450"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Zmk-PV-di2">
<rect key="frame" x="0.0" y="0.0" width="422.5" height="500"/>
<rect key="frame" x="0.0" y="0.0" width="642" height="450"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="iQu-2n-Y3T">
<rect key="frame" x="438.5" y="0.0" width="423" height="500"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="OZT-Lo-t7S">
<rect key="frame" x="877.5" y="0.0" width="422.5" height="500"/>
<rect key="frame" x="658" y="0.0" width="642" height="450"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</view>
</subviews>
<constraints>
<constraint firstAttribute="height" constant="500" id="zmA-DP-mDx"/>
<constraint firstAttribute="height" constant="450" id="zmA-DP-mDx"/>
</constraints>
</stackView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Zdb-H8-Dy2" userLabel="Space">
<rect key="frame" x="0.0" y="1560" width="1300" height="40"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="40" id="mp4-0v-Scg"/>
</constraints>
<viewLayoutGuide key="safeArea" id="DfJ-ph-q9S"/>
</view>
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" spacing="16" translatesAutoresizingMaskIntoConstraints="NO" id="ucv-f0-P2r">
<rect key="frame" x="0.0" y="1670" width="1300" height="280"/>
<rect key="frame" x="0.0" y="1610" width="1300" height="280"/>
<subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="grouped" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="18" sectionFooterHeight="18" translatesAutoresizingMaskIntoConstraints="NO" id="0h6-mp-rHD" customClass="TableView" customModule="TournamentStats" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="1300" height="280"/>
@ -161,8 +143,16 @@
<constraint firstAttribute="height" constant="280" id="Qi4-FK-vXH"/>
</constraints>
</stackView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="fZP-2C-MlN" userLabel="Space">
<rect key="frame" x="0.0" y="1900" width="1300" height="40"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="40" id="G0u-JL-8Ed"/>
</constraints>
<viewLayoutGuide key="safeArea" id="3AK-Jb-LaH"/>
</view>
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" spacing="16" translatesAutoresizingMaskIntoConstraints="NO" id="JSX-zY-CFg">
<rect key="frame" x="0.0" y="1960" width="1300" height="280"/>
<rect key="frame" x="0.0" y="1950" width="1300" height="280"/>
<subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="grouped" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="18" sectionFooterHeight="18" translatesAutoresizingMaskIntoConstraints="NO" id="h84-Ta-8eQ" customClass="TableView" customModule="TournamentStats" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="1300" height="280"/>
@ -173,18 +163,26 @@
<constraint firstAttribute="height" constant="280" id="e22-At-bAV"/>
</constraints>
</stackView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Tt8-Z5-vVb" userLabel="Space">
<rect key="frame" x="0.0" y="2240" width="1300" height="40"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="40" id="vnz-WB-g1y"/>
</constraints>
<viewLayoutGuide key="safeArea" id="HMN-3V-5QB"/>
</view>
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillProportionally" translatesAutoresizingMaskIntoConstraints="NO" id="WFa-d3-zcU">
<rect key="frame" x="0.0" y="2250" width="1300" height="40"/>
<rect key="frame" x="0.0" y="2290" width="1300" height="40"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="aSt-Fm-PHF" customClass="Label" customModule="TournamentStats" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="650" height="40"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="aSt-Fm-PHF" customClass="Label" customModule="TournamentStats" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="584" height="40"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="wcd-nU-zRB" customClass="Label" customModule="TournamentStats" customModuleProvider="target">
<rect key="frame" x="650" y="0.0" width="650" height="40"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="wcd-nU-zRB" customClass="Label" customModule="TournamentStats" customModuleProvider="target">
<rect key="frame" x="584" y="0.0" width="716" height="40"/>
<fontDescription key="fontDescription" name="Menlo-Regular" family="Menlo" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
@ -194,7 +192,7 @@
</constraints>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" spacing="16" translatesAutoresizingMaskIntoConstraints="NO" id="9WN-7G-oBN">
<rect key="frame" x="0.0" y="2300" width="1300" height="500"/>
<rect key="frame" x="0.0" y="2340" width="1300" height="500"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="YMb-PS-dFz">
<rect key="frame" x="0.0" y="0.0" width="642" height="500"/>
@ -210,7 +208,7 @@
</constraints>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillProportionally" translatesAutoresizingMaskIntoConstraints="NO" id="myS-g5-vsP">
<rect key="frame" x="0.0" y="2810" width="1300" height="50"/>
<rect key="frame" x="0.0" y="2850" width="1300" height="50"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="mDV-nN-W7V" customClass="Label" customModule="TournamentStats" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="650" height="50"/>
@ -230,7 +228,7 @@
</constraints>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" spacing="16" translatesAutoresizingMaskIntoConstraints="NO" id="2iy-YX-agg">
<rect key="frame" x="0.0" y="2870" width="1300" height="500"/>
<rect key="frame" x="0.0" y="2910" width="1300" height="500"/>
<subviews>
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="none" translatesAutoresizingMaskIntoConstraints="NO" id="tVi-Bi-Ese">
<rect key="frame" x="0.0" y="0.0" width="422.5" height="500"/>
@ -271,7 +269,6 @@
<outlet property="collectionView51" destination="tVi-Bi-Ese" id="f6M-Za-9IQ"/>
<outlet property="container21" destination="Zmk-PV-di2" id="mv0-Sg-r5V"/>
<outlet property="container22" destination="iQu-2n-Y3T" id="Yhg-KD-vzU"/>
<outlet property="container23" destination="OZT-Lo-t7S" id="QcZ-kf-CTr"/>
<outlet property="container41" destination="YMb-PS-dFz" id="siA-pY-GZT"/>
<outlet property="container42" destination="LJL-hy-odj" id="7Bq-4v-uda"/>
<outlet property="hStack1b" destination="ABP-ce-MDa" id="44B-nQ-AOq"/>
@ -283,11 +280,8 @@
<outlet property="hStack5a" destination="myS-g5-vsP" id="S4L-12-8qP"/>
<outlet property="hStack5b" destination="2iy-YX-agg" id="iqW-bN-4fc"/>
<outlet property="infographyTitle" destination="4Hu-Ou-nFd" id="0vL-nP-fjY"/>
<outlet property="label12" destination="VWQ-ZA-7rt" id="OBf-Fx-clC"/>
<outlet property="label13" destination="iaM-v8-HTO" id="Li5-T2-st6"/>
<outlet property="label21" destination="Hcr-dr-rUz" id="Ggb-ck-2Y7"/>
<outlet property="label22" destination="2yf-Z5-Tpy" id="5yK-A5-sha"/>
<outlet property="label23" destination="hcG-kJ-HS1" id="iKw-Dy-B6C"/>
<outlet property="label41" destination="aSt-Fm-PHF" id="43C-8N-8Xk"/>
<outlet property="label42" destination="wcd-nU-zRB" id="WAR-I1-Bej"/>
<outlet property="label51" destination="mDV-nN-W7V" id="QlS-da-9bL"/>

@ -11,6 +11,13 @@ import UIKit
class StatCollectionViewCell: UICollectionViewCell {
override func awakeFromNib() {
super.awakeFromNib()
// self.layer.borderColor = UIColor.white.cgColor
// self.layer.borderWidth = 1.0
}
@IBOutlet weak var nameLabel: UILabel!
@IBOutlet weak var valueLabel: UILabel!

@ -29,7 +29,7 @@
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="FkP-so-0B7" userLabel="Value">
<rect key="frame" x="8" y="36" width="328" height="56"/>
<rect key="frame" x="8" y="34" width="328" height="58"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
@ -40,7 +40,7 @@
<constraint firstItem="M1K-Qd-Z8y" firstAttribute="top" secondItem="Ua3-L2-QPG" secondAttribute="top" constant="8" id="5ba-YO-Iuh"/>
<constraint firstItem="M1K-Qd-Z8y" firstAttribute="leading" secondItem="Ua3-L2-QPG" secondAttribute="leading" constant="8" id="DNu-yX-KiG"/>
<constraint firstAttribute="trailing" secondItem="M1K-Qd-Z8y" secondAttribute="trailing" constant="8" id="Fib-tI-dzT"/>
<constraint firstItem="FkP-so-0B7" firstAttribute="top" secondItem="M1K-Qd-Z8y" secondAttribute="bottom" constant="4" id="UOR-47-lzI"/>
<constraint firstItem="FkP-so-0B7" firstAttribute="top" secondItem="M1K-Qd-Z8y" secondAttribute="bottom" constant="2" id="UOR-47-lzI"/>
<constraint firstAttribute="trailing" secondItem="FkP-so-0B7" secondAttribute="trailing" constant="8" id="d3G-1w-NXT"/>
<constraint firstItem="FkP-so-0B7" firstAttribute="leading" secondItem="Ua3-L2-QPG" secondAttribute="leading" constant="8" id="lXd-Fg-DzQ"/>
<constraint firstAttribute="bottom" secondItem="FkP-so-0B7" secondAttribute="bottom" constant="8" id="oum-uT-owE"/>

@ -209,10 +209,10 @@ class Queries {
let tournaments: Results<Tournament> = realm.objects(Tournament.self)
let verylow = DistributionCounter(name: "Very Low (<$1,000)")
let low = DistributionCounter(name: "Low ($1,000 - $1,999)")
let medium = DistributionCounter(name: "Medium ($2,000 - $5,000)")
let high = DistributionCounter(name: "High (> $5,000)")
let verylow = DistributionCounter(name: "< $1,000")
let low = DistributionCounter(name: "$1,000 - $1,999")
let medium = DistributionCounter(name: "$2,000 - $5,000")
let high = DistributionCounter(name: "> $5,000")
let counters: [DistributionCounter] = [verylow, low, medium, high]
tournaments.forEach { tournament in

@ -50,14 +50,14 @@ class FestivalStats : NSObject, UICollectionViewDataSource, UICollectionViewDele
cell.nameLabel.textColor = UIColor.white
cell.valueLabel.textColor = UIColor.white
cell.nameLabel.font = UIFont.systemFont(ofSize: 20.0)
cell.valueLabel.font = UIFont.systemFont(ofSize: 56.0, weight: .thin)
cell.nameLabel.font = Fonts.regular
cell.valueLabel.font = Fonts.bigNumbers
return cell
}
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
return CGSize(width: 360.0, height: 100.0)
return CGSize(width: 380.0, height: 90.0)
}
}

@ -14,10 +14,10 @@ struct TournamentRepresentable : HTMLRepresentable {
static func columnDescriptors() -> [ColumnDescriptor] {
return [ColumnDescriptor(header: "#", number: true, widthWeight: 0.3),
ColumnDescriptor(header: "Buy-in", number: true, widthWeight: 0.7),
ColumnDescriptor(header: "Buy-in", number: true, widthWeight: 0.5),
ColumnDescriptor(header: "Event", number: false, widthWeight: 2.6),
ColumnDescriptor(header: "Prizepool", number: true, widthWeight: 1.0),
ColumnDescriptor(header: "Entries", number: true, widthWeight: 0.7)]
ColumnDescriptor(header: "Entries", number: true, widthWeight: 0.6)]
}
func cellValues() -> [String] {

@ -125,7 +125,7 @@ class TournamentStats : NSObject, HTMLRepresentable, UITableViewDelegate, UITabl
// MARK: - UICollectionViewDataSource
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return 4
return 3
}
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
@ -156,14 +156,14 @@ class TournamentStats : NSObject, HTMLRepresentable, UITableViewDelegate, UITabl
cell.nameLabel.textColor = UIColor.white
cell.valueLabel.textColor = UIColor.white
cell.nameLabel.font = UIFont.systemFont(ofSize: 20.0)
cell.valueLabel.font = UIFont.systemFont(ofSize: 56.0, weight: .thin)
cell.nameLabel.font = Fonts.regular
cell.valueLabel.font = Fonts.bigNumbers
return cell
}
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
return CGSize(width: 360.0, height: 100.0)
return CGSize(width: 380.0, height: 90.0)
}
}

Loading…
Cancel
Save