finalizing the layout

master
Laurent 6 years ago
parent 99e68a1217
commit 879633d290
  1. 4
      TournamentStats.xcodeproj/project.pbxproj
  2. 6
      TournamentStats.xcodeproj/xcuserdata/laurent.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
  3. 28
      TournamentStats/UI/reports/InfographyView.swift
  4. 72
      TournamentStats/UI/reports/InfographyView.xib
  5. 23
      TournamentStats/report/Queries.swift
  6. 3
      TournamentStats/report/ReportGenerator.swift
  7. 2
      TournamentStats/report/structures/FestivalStats.swift
  8. 8
      TournamentStats/report/structures/PlayerNotableFinishes.swift
  9. 5
      TournamentStats/report/structures/TournamentCounter.swift
  10. 2
      TournamentStats/report/structures/TournamentStats.swift
  11. 22
      TournamentStats/utils/TableSize.swift

@ -46,6 +46,7 @@
4D39B6FA22F85C3400625E31 /* UIView+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4D39B6F922F85C3400625E31 /* UIView+Extensions.swift */; }; 4D39B6FA22F85C3400625E31 /* UIView+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4D39B6F922F85C3400625E31 /* UIView+Extensions.swift */; };
4D39B6FC22F8686300625E31 /* CumulatedWins.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4D39B6FB22F8686300625E31 /* CumulatedWins.swift */; }; 4D39B6FC22F8686300625E31 /* CumulatedWins.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4D39B6FB22F8686300625E31 /* CumulatedWins.swift */; };
4D39B6FE22F87C3700625E31 /* Charts.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D39B6FD22F87C3700625E31 /* Charts.framework */; }; 4D39B6FE22F87C3700625E31 /* Charts.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D39B6FD22F87C3700625E31 /* Charts.framework */; };
4D5425CA23190EA900B16ECF /* TableSize.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4D5425C923190EA900B16ECF /* TableSize.swift */; };
4DA5CA1E22AD078A00AC628E /* CountryCounter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4DA5CA1D22AD078A00AC628E /* CountryCounter.swift */; }; 4DA5CA1E22AD078A00AC628E /* CountryCounter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4DA5CA1D22AD078A00AC628E /* CountryCounter.swift */; };
4DB113D72305480600D0C671 /* InfographyView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4DB113D62305480600D0C671 /* InfographyView.xib */; }; 4DB113D72305480600D0C671 /* InfographyView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4DB113D62305480600D0C671 /* InfographyView.xib */; };
4DB113D923054A4100D0C671 /* InfographyView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4DB113D823054A4100D0C671 /* InfographyView.swift */; }; 4DB113D923054A4100D0C671 /* InfographyView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4DB113D823054A4100D0C671 /* InfographyView.swift */; };
@ -196,6 +197,7 @@
4D39B6F922F85C3400625E31 /* UIView+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIView+Extensions.swift"; sourceTree = "<group>"; }; 4D39B6F922F85C3400625E31 /* UIView+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIView+Extensions.swift"; sourceTree = "<group>"; };
4D39B6FB22F8686300625E31 /* CumulatedWins.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CumulatedWins.swift; sourceTree = "<group>"; }; 4D39B6FB22F8686300625E31 /* CumulatedWins.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CumulatedWins.swift; sourceTree = "<group>"; };
4D39B6FD22F87C3700625E31 /* Charts.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Charts.framework; path = Carthage/Build/iOS/Charts.framework; sourceTree = "<group>"; }; 4D39B6FD22F87C3700625E31 /* Charts.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Charts.framework; path = Carthage/Build/iOS/Charts.framework; sourceTree = "<group>"; };
4D5425C923190EA900B16ECF /* TableSize.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TableSize.swift; sourceTree = "<group>"; };
4DA5CA1D22AD078A00AC628E /* CountryCounter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CountryCounter.swift; sourceTree = "<group>"; }; 4DA5CA1D22AD078A00AC628E /* CountryCounter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CountryCounter.swift; sourceTree = "<group>"; };
4DB113D62305480600D0C671 /* InfographyView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = InfographyView.xib; sourceTree = "<group>"; }; 4DB113D62305480600D0C671 /* InfographyView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = InfographyView.xib; sourceTree = "<group>"; };
4DB113D823054A4100D0C671 /* InfographyView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InfographyView.swift; sourceTree = "<group>"; }; 4DB113D823054A4100D0C671 /* InfographyView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InfographyView.swift; sourceTree = "<group>"; };
@ -528,6 +530,7 @@
4DF760C122A561FF004B0EF1 /* ColumnRepresentable.swift */, 4DF760C122A561FF004B0EF1 /* ColumnRepresentable.swift */,
4DF760BE22A560AA004B0EF1 /* FileWriter.swift */, 4DF760BE22A560AA004B0EF1 /* FileWriter.swift */,
4D26A95323156F6F001C98D2 /* Game.swift */, 4D26A95323156F6F001C98D2 /* Game.swift */,
4D5425C923190EA900B16ECF /* TableSize.swift */,
); );
path = utils; path = utils;
sourceTree = "<group>"; sourceTree = "<group>";
@ -805,6 +808,7 @@
4D26A94D23152316001C98D2 /* FestivalStats.swift in Sources */, 4D26A94D23152316001C98D2 /* FestivalStats.swift in Sources */,
4DF78DD622F9CE7E00C02F73 /* TitleLabel.swift in Sources */, 4DF78DD622F9CE7E00C02F73 /* TitleLabel.swift in Sources */,
4DF7615122A7AECA004B0EF1 /* TournamentRepresentable.swift in Sources */, 4DF7615122A7AECA004B0EF1 /* TournamentRepresentable.swift in Sources */,
4D5425CA23190EA900B16ECF /* TableSize.swift in Sources */,
4DF7608622A3FB96004B0EF1 /* MasterViewController.swift in Sources */, 4DF7608622A3FB96004B0EF1 /* MasterViewController.swift in Sources */,
4DF7608422A3FB96004B0EF1 /* AppDelegate.swift in Sources */, 4DF7608422A3FB96004B0EF1 /* AppDelegate.swift in Sources */,
4D39B6F322F8549100625E31 /* DataSourceWrapper.swift in Sources */, 4D39B6F322F8549100625E31 /* DataSourceWrapper.swift in Sources */,

@ -18,11 +18,11 @@
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
filePath = "TournamentStats/report/ReportGenerator.swift" filePath = "TournamentStats/report/ReportGenerator.swift"
timestampString = "588790717.262743" timestampString = "588847576.95691"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "82" startingLineNumber = "83"
endingLineNumber = "82" endingLineNumber = "83"
landmarkName = "generateReports()" landmarkName = "generateReports()"
landmarkType = "7"> landmarkType = "7">
</BreakpointContent> </BreakpointContent>

@ -64,10 +64,12 @@ class InfographyView: UIView {
@IBOutlet weak var hStack5a: UIStackView! @IBOutlet weak var hStack5a: UIStackView!
@IBOutlet weak var label51: UILabel! @IBOutlet weak var label51: UILabel!
@IBOutlet weak var labelTableSize: Label!
@IBOutlet weak var hStack5b: UIStackView! @IBOutlet weak var hStack5b: UIStackView!
@IBOutlet weak var collectionView51: UICollectionView! @IBOutlet weak var collectionView51: UICollectionView!
@IBOutlet weak var containerTableSize: UIView!
override func awakeFromNib() { override func awakeFromNib() {
super.awakeFromNib() super.awakeFromNib()
@ -75,21 +77,8 @@ class InfographyView: UIView {
} }
fileprivate func _createBackground() { fileprivate func _createBackground() {
let startColor = UIColor(red: 23/255, green: 72/255, blue: 61/255, alpha: 1) let startColor = UIColor(red: 23/255, green: 72/255, blue: 61/255, alpha: 1)
// let endColor = UIColor(red: 47/255, green: 149/255, blue: 126/255, alpha: 1)
self.backgroundColor = startColor self.backgroundColor = startColor
// let gradient: CAGradientLayer = CAGradientLayer()
// gradient.colors = [startColor.cgColor, endColor.cgColor]
// gradient.locations = [0.2 , 1.0]
// gradient.startPoint = CGPoint(x: 0.0, y: 0.0)
// gradient.endPoint = CGPoint(x: 1.0, y: 1.0)
// gradient.frame = self.bounds
//
// self.layer.insertSublayer(gradient, at: 0)
} }
fileprivate func _fillView() { fileprivate func _fillView() {
@ -129,7 +118,6 @@ class InfographyView: UIView {
self.label21.text = "Buy-in distribution" self.label21.text = "Buy-in distribution"
self.label22.text = "First prizes distribution" self.label22.text = "First prizes distribution"
// self.label23.text = "Prizepool distribution".uppercased()
let pieChartFrame = CGRect(x: 0, y: 0, width: 650, height: 500) let pieChartFrame = CGRect(x: 0, y: 0, width: 650, height: 500)
let buyinDistribPie = PieChart(frame: pieChartFrame) let buyinDistribPie = PieChart(frame: pieChartFrame)
@ -139,10 +127,6 @@ class InfographyView: UIView {
let firstPrizeDistributionPie = PieChart(frame: pieChartFrame) let firstPrizeDistributionPie = PieChart(frame: pieChartFrame)
firstPrizeDistributionPie.data = generator.firstPrizeDistribution.pieChartData firstPrizeDistributionPie.data = generator.firstPrizeDistribution.pieChartData
self.container22.addSubview(firstPrizeDistributionPie) self.container22.addSubview(firstPrizeDistributionPie)
// let prizepoolDistribPie = PieChart(frame: pieChartFrame)
// prizepoolDistribPie.data = generator.tournamentPrizepoolDistribution.pieChartData
// self.container23.addSubview(prizepoolDistribPie)
///// /////
@ -153,7 +137,7 @@ class InfographyView: UIView {
///// /////
self.label41.text = "USA vs World bracelets" self.label41.text = "USA vs. World bracelets"
self.label42.text = "Games distribution" self.label42.text = "Games distribution"
let USABraceletsDistribPie = PieChart(frame: pieChartFrame) let USABraceletsDistribPie = PieChart(frame: pieChartFrame)
@ -172,6 +156,10 @@ class InfographyView: UIView {
self.collectionView51.dataSource = ds self.collectionView51.dataSource = ds
self.collectionView51.delegate = ds self.collectionView51.delegate = ds
self.labelTableSize.text = "Table Size Distribution"
let tableSizeDistributionPie = PieChart(frame: pieChartFrame)
tableSizeDistributionPie.data = generator.tableSizeDistribution.pieChartData
self.containerTableSize.addSubview(tableSizeDistributionPie)
} }
} }

@ -13,11 +13,11 @@
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/> <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="iN0-l3-epB" customClass="InfographyView" customModule="TournamentStats" customModuleProvider="target"> <view contentMode="scaleToFill" id="iN0-l3-epB" customClass="InfographyView" customModule="TournamentStats" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="1500" height="4500"/> <rect key="frame" x="0.0" y="0.0" width="1500" height="4100"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="w79-xx-Evx"> <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="4060"/> <rect key="frame" x="100" y="44" width="1300" height="3985"/>
<subviews> <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"> <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"/> <rect key="frame" x="0.0" y="0.0" width="1300" height="100"/>
@ -72,23 +72,23 @@
<viewLayoutGuide key="safeArea" id="xzI-Ex-mMX"/> <viewLayoutGuide key="safeArea" id="xzI-Ex-mMX"/>
</view> </view>
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillProportionally" spacing="50" translatesAutoresizingMaskIntoConstraints="NO" id="l2y-sT-HQT"> <stackView opaque="NO" contentMode="scaleToFill" distribution="fillProportionally" spacing="50" translatesAutoresizingMaskIntoConstraints="NO" id="l2y-sT-HQT">
<rect key="frame" x="0.0" y="740" width="1300" height="540"/> <rect key="frame" x="0.0" y="740" width="1300" height="465"/>
<subviews> <subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="uYQ-6Z-Rb4" customClass="TableView" customModule="TournamentStats" customModuleProvider="target"> <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="uYQ-6Z-Rb4" customClass="TableView" customModule="TournamentStats" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="627.5" height="540"/> <rect key="frame" x="0.0" y="0.0" width="627.5" height="465"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</tableView> </tableView>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="grouped" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="18" sectionFooterHeight="18" translatesAutoresizingMaskIntoConstraints="NO" id="ubP-cm-Sbp" customClass="TableView" customModule="TournamentStats" customModuleProvider="target"> <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="grouped" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="18" sectionFooterHeight="18" translatesAutoresizingMaskIntoConstraints="NO" id="ubP-cm-Sbp" customClass="TableView" customModule="TournamentStats" customModuleProvider="target">
<rect key="frame" x="677.5" y="0.0" width="622.5" height="540"/> <rect key="frame" x="677.5" y="0.0" width="622.5" height="465"/>
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/> <color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
</tableView> </tableView>
</subviews> </subviews>
<constraints> <constraints>
<constraint firstAttribute="height" constant="540" id="NZj-7i-hbE"/> <constraint firstAttribute="height" constant="465" id="NZj-7i-hbE"/>
</constraints> </constraints>
</stackView> </stackView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Xrv-gg-4dD" userLabel="Space"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Xrv-gg-4dD" userLabel="Space">
<rect key="frame" x="0.0" y="1290" width="1300" height="50"/> <rect key="frame" x="0.0" y="1215" width="1300" height="50"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="50" id="z1Q-lp-yMy"/> <constraint firstAttribute="height" constant="50" id="z1Q-lp-yMy"/>
@ -96,7 +96,7 @@
<viewLayoutGuide key="safeArea" id="x7x-j2-Rbi"/> <viewLayoutGuide key="safeArea" id="x7x-j2-Rbi"/>
</view> </view>
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" spacing="50" translatesAutoresizingMaskIntoConstraints="NO" id="NbO-FE-SHj"> <stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" spacing="50" translatesAutoresizingMaskIntoConstraints="NO" id="NbO-FE-SHj">
<rect key="frame" x="0.0" y="1350" width="1300" height="300"/> <rect key="frame" x="0.0" y="1275" width="1300" height="300"/>
<subviews> <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"> <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"/> <rect key="frame" x="0.0" y="0.0" width="625" height="300"/>
@ -112,7 +112,7 @@
</constraints> </constraints>
</stackView> </stackView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="gTW-Xs-enM" userLabel="Space"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="gTW-Xs-enM" userLabel="Space">
<rect key="frame" x="0.0" y="1660" width="1300" height="40"/> <rect key="frame" x="0.0" y="1585" width="1300" height="40"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="40" id="DCa-vu-Hao"/> <constraint firstAttribute="height" constant="40" id="DCa-vu-Hao"/>
@ -120,7 +120,7 @@
<viewLayoutGuide key="safeArea" id="PMJ-8b-M0C"/> <viewLayoutGuide key="safeArea" id="PMJ-8b-M0C"/>
</view> </view>
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillProportionally" translatesAutoresizingMaskIntoConstraints="NO" id="91U-hc-Oqn"> <stackView opaque="NO" contentMode="scaleToFill" distribution="fillProportionally" translatesAutoresizingMaskIntoConstraints="NO" id="91U-hc-Oqn">
<rect key="frame" x="0.0" y="1710" width="1300" height="30"/> <rect key="frame" x="0.0" y="1635" width="1300" height="30"/>
<subviews> <subviews>
<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"> <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="30"/> <rect key="frame" x="0.0" y="0.0" width="650" height="30"/>
@ -140,7 +140,7 @@
</constraints> </constraints>
</stackView> </stackView>
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" spacing="16" translatesAutoresizingMaskIntoConstraints="NO" id="4u9-3E-Qwu"> <stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" spacing="16" translatesAutoresizingMaskIntoConstraints="NO" id="4u9-3E-Qwu">
<rect key="frame" x="0.0" y="1750" width="1300" height="450"/> <rect key="frame" x="0.0" y="1675" width="1300" height="450"/>
<subviews> <subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Zmk-PV-di2"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Zmk-PV-di2">
<rect key="frame" x="0.0" y="0.0" width="642" height="450"/> <rect key="frame" x="0.0" y="0.0" width="642" height="450"/>
@ -156,7 +156,7 @@
</constraints> </constraints>
</stackView> </stackView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Zdb-H8-Dy2" userLabel="Space"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Zdb-H8-Dy2" userLabel="Space">
<rect key="frame" x="0.0" y="2210" width="1300" height="40"/> <rect key="frame" x="0.0" y="2135" width="1300" height="40"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="40" id="mp4-0v-Scg"/> <constraint firstAttribute="height" constant="40" id="mp4-0v-Scg"/>
@ -164,7 +164,7 @@
<viewLayoutGuide key="safeArea" id="DfJ-ph-q9S"/> <viewLayoutGuide key="safeArea" id="DfJ-ph-q9S"/>
</view> </view>
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" spacing="16" translatesAutoresizingMaskIntoConstraints="NO" id="ucv-f0-P2r"> <stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" spacing="16" translatesAutoresizingMaskIntoConstraints="NO" id="ucv-f0-P2r">
<rect key="frame" x="0.0" y="2260" width="1300" height="280"/> <rect key="frame" x="0.0" y="2185" width="1300" height="280"/>
<subviews> <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"> <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"/> <rect key="frame" x="0.0" y="0.0" width="1300" height="280"/>
@ -176,7 +176,7 @@
</constraints> </constraints>
</stackView> </stackView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="fZP-2C-MlN" userLabel="Space"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="fZP-2C-MlN" userLabel="Space">
<rect key="frame" x="0.0" y="2550" width="1300" height="40"/> <rect key="frame" x="0.0" y="2475" width="1300" height="40"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="40" id="G0u-JL-8Ed"/> <constraint firstAttribute="height" constant="40" id="G0u-JL-8Ed"/>
@ -184,7 +184,7 @@
<viewLayoutGuide key="safeArea" id="3AK-Jb-LaH"/> <viewLayoutGuide key="safeArea" id="3AK-Jb-LaH"/>
</view> </view>
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" spacing="16" translatesAutoresizingMaskIntoConstraints="NO" id="JSX-zY-CFg"> <stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" spacing="16" translatesAutoresizingMaskIntoConstraints="NO" id="JSX-zY-CFg">
<rect key="frame" x="0.0" y="2600" width="1300" height="280"/> <rect key="frame" x="0.0" y="2525" width="1300" height="280"/>
<subviews> <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"> <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"/> <rect key="frame" x="0.0" y="0.0" width="1300" height="280"/>
@ -196,7 +196,7 @@
</constraints> </constraints>
</stackView> </stackView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Tt8-Z5-vVb" userLabel="Space"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Tt8-Z5-vVb" userLabel="Space">
<rect key="frame" x="0.0" y="2890" width="1300" height="40"/> <rect key="frame" x="0.0" y="2815" width="1300" height="40"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="40" id="vnz-WB-g1y"/> <constraint firstAttribute="height" constant="40" id="vnz-WB-g1y"/>
@ -204,7 +204,7 @@
<viewLayoutGuide key="safeArea" id="HMN-3V-5QB"/> <viewLayoutGuide key="safeArea" id="HMN-3V-5QB"/>
</view> </view>
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" translatesAutoresizingMaskIntoConstraints="NO" id="WFa-d3-zcU"> <stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" translatesAutoresizingMaskIntoConstraints="NO" id="WFa-d3-zcU">
<rect key="frame" x="0.0" y="2940" width="1300" height="40"/> <rect key="frame" x="0.0" y="2865" width="1300" height="40"/>
<subviews> <subviews>
<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"> <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="650" height="40"/> <rect key="frame" x="0.0" y="0.0" width="650" height="40"/>
@ -224,7 +224,7 @@
</constraints> </constraints>
</stackView> </stackView>
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" spacing="16" translatesAutoresizingMaskIntoConstraints="NO" id="9WN-7G-oBN"> <stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" spacing="16" translatesAutoresizingMaskIntoConstraints="NO" id="9WN-7G-oBN">
<rect key="frame" x="0.0" y="2990" width="1300" height="500"/> <rect key="frame" x="0.0" y="2915" width="1300" height="500"/>
<subviews> <subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="YMb-PS-dFz"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="YMb-PS-dFz">
<rect key="frame" x="0.0" y="0.0" width="642" height="500"/> <rect key="frame" x="0.0" y="0.0" width="642" height="500"/>
@ -240,15 +240,15 @@
</constraints> </constraints>
</stackView> </stackView>
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" translatesAutoresizingMaskIntoConstraints="NO" id="myS-g5-vsP"> <stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" translatesAutoresizingMaskIntoConstraints="NO" id="myS-g5-vsP">
<rect key="frame" x="0.0" y="3500" width="1300" height="50"/> <rect key="frame" x="0.0" y="3425" width="1300" height="50"/>
<subviews> <subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="mDV-nN-W7V" customClass="Label" customModule="TournamentStats" customModuleProvider="target"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="t1" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="7xF-BM-RBb" customClass="Label" customModule="TournamentStats" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="650" height="50"/> <rect key="frame" x="0.0" y="0.0" width="650" height="50"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/> <fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/> <nil key="textColor"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="7xF-BM-RBb" customClass="Label" customModule="TournamentStats" customModuleProvider="target"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="mDV-nN-W7V" customClass="Label" customModule="TournamentStats" customModuleProvider="target">
<rect key="frame" x="650" y="0.0" width="650" height="50"/> <rect key="frame" x="650" y="0.0" width="650" height="50"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/> <fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/> <nil key="textColor"/>
@ -260,10 +260,14 @@
</constraints> </constraints>
</stackView> </stackView>
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" spacing="16" translatesAutoresizingMaskIntoConstraints="NO" id="2iy-YX-agg"> <stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" spacing="16" translatesAutoresizingMaskIntoConstraints="NO" id="2iy-YX-agg">
<rect key="frame" x="0.0" y="3560" width="1300" height="500"/> <rect key="frame" x="0.0" y="3485" width="1300" height="500"/>
<subviews> <subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="X1y-8P-5GO">
<rect key="frame" x="0.0" y="0.0" width="642" height="500"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</view>
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="none" translatesAutoresizingMaskIntoConstraints="NO" id="tVi-Bi-Ese"> <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"/> <rect key="frame" x="658" y="0.0" width="642" height="500"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="10" minimumInteritemSpacing="10" id="G6p-YK-B8A"> <collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="10" minimumInteritemSpacing="10" id="G6p-YK-B8A">
<size key="itemSize" width="50" height="50"/> <size key="itemSize" width="50" height="50"/>
@ -272,14 +276,6 @@
<inset key="sectionInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/> <inset key="sectionInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
</collectionViewFlowLayout> </collectionViewFlowLayout>
</collectionView> </collectionView>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="grouped" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="18" sectionFooterHeight="18" translatesAutoresizingMaskIntoConstraints="NO" id="vqG-Pt-IB2" customClass="TableView" customModule="TournamentStats" customModuleProvider="target">
<rect key="frame" x="438.5" y="0.0" width="423" height="500"/>
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
</tableView>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="grouped" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="18" sectionFooterHeight="18" translatesAutoresizingMaskIntoConstraints="NO" id="bPn-x2-2H0" customClass="TableView" customModule="TournamentStats" customModuleProvider="target">
<rect key="frame" x="877.5" y="0.0" width="422.5" height="500"/>
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
</tableView>
</subviews> </subviews>
<constraints> <constraints>
<constraint firstAttribute="height" constant="500" id="U4b-yO-LB0"/> <constraint firstAttribute="height" constant="500" id="U4b-yO-LB0"/>
@ -287,11 +283,23 @@
</stackView> </stackView>
</subviews> </subviews>
</stackView> </stackView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Assembled by Team Poker Analytics" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Jzz-Nv-WGn">
<rect key="frame" x="8" y="4062" width="1478" height="30"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="i5V-jC-imt"/>
</constraints>
<fontDescription key="fontDescription" name="Menlo-Regular" family="Menlo" pointSize="15"/>
<color key="textColor" red="0.0" green="1" blue="0.7680094838" alpha="0.51496067180000005" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews> </subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints> <constraints>
<constraint firstItem="vUN-kp-3ea" firstAttribute="trailing" secondItem="w79-xx-Evx" secondAttribute="trailing" constant="100" id="4VD-EL-9RH"/> <constraint firstItem="vUN-kp-3ea" firstAttribute="trailing" secondItem="w79-xx-Evx" secondAttribute="trailing" constant="100" id="4VD-EL-9RH"/>
<constraint firstItem="Jzz-Nv-WGn" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" constant="8" id="HnQ-Ow-wNx"/>
<constraint firstItem="vUN-kp-3ea" firstAttribute="trailing" secondItem="Jzz-Nv-WGn" secondAttribute="trailing" constant="14" id="nwD-KF-aWK"/>
<constraint firstItem="w79-xx-Evx" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" constant="100" id="stc-gy-e36"/> <constraint firstItem="w79-xx-Evx" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" constant="100" id="stc-gy-e36"/>
<constraint firstAttribute="bottom" secondItem="Jzz-Nv-WGn" secondAttribute="bottom" constant="8" id="uTQ-dy-IJ0"/>
<constraint firstItem="w79-xx-Evx" firstAttribute="top" secondItem="vUN-kp-3ea" secondAttribute="top" id="usO-r7-R25"/> <constraint firstItem="w79-xx-Evx" firstAttribute="top" secondItem="vUN-kp-3ea" secondAttribute="top" id="usO-r7-R25"/>
</constraints> </constraints>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/> <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
@ -303,6 +311,7 @@
<outlet property="container22" destination="iQu-2n-Y3T" id="Yhg-KD-vzU"/> <outlet property="container22" destination="iQu-2n-Y3T" id="Yhg-KD-vzU"/>
<outlet property="container41" destination="YMb-PS-dFz" id="siA-pY-GZT"/> <outlet property="container41" destination="YMb-PS-dFz" id="siA-pY-GZT"/>
<outlet property="container42" destination="LJL-hy-odj" id="7Bq-4v-uda"/> <outlet property="container42" destination="LJL-hy-odj" id="7Bq-4v-uda"/>
<outlet property="containerTableSize" destination="X1y-8P-5GO" id="bFd-fl-9WZ"/>
<outlet property="hStack1b" destination="ABP-ce-MDa" id="44B-nQ-AOq"/> <outlet property="hStack1b" destination="ABP-ce-MDa" id="44B-nQ-AOq"/>
<outlet property="hStack2a" destination="91U-hc-Oqn" id="5b4-H7-FU3"/> <outlet property="hStack2a" destination="91U-hc-Oqn" id="5b4-H7-FU3"/>
<outlet property="hStack2b" destination="4u9-3E-Qwu" id="14V-Za-4Iz"/> <outlet property="hStack2b" destination="4u9-3E-Qwu" id="14V-Za-4Iz"/>
@ -317,6 +326,7 @@
<outlet property="label41" destination="aSt-Fm-PHF" id="43C-8N-8Xk"/> <outlet property="label41" destination="aSt-Fm-PHF" id="43C-8N-8Xk"/>
<outlet property="label42" destination="wcd-nU-zRB" id="WAR-I1-Bej"/> <outlet property="label42" destination="wcd-nU-zRB" id="WAR-I1-Bej"/>
<outlet property="label51" destination="mDV-nN-W7V" id="QlS-da-9bL"/> <outlet property="label51" destination="mDV-nN-W7V" id="QlS-da-9bL"/>
<outlet property="labelTableSize" destination="7xF-BM-RBb" id="fCv-dl-xcS"/>
<outlet property="mostTableView" destination="uYQ-6Z-Rb4" id="Jeb-OU-Gj8"/> <outlet property="mostTableView" destination="uYQ-6Z-Rb4" id="Jeb-OU-Gj8"/>
<outlet property="mostTableView2" destination="ubP-cm-Sbp" id="a9y-yZ-4EW"/> <outlet property="mostTableView2" destination="ubP-cm-Sbp" id="a9y-yZ-4EW"/>
<outlet property="tableView11" destination="HbR-TC-HeD" id="P5k-OS-JgN"/> <outlet property="tableView11" destination="HbR-TC-HeD" id="P5k-OS-JgN"/>

@ -297,6 +297,29 @@ class Queries {
return games return games
} }
static func tableSizeDistribution(realm: Realm) -> [DistributionCounter] {
let tournaments: Results<Tournament> = realm.objects(Tournament.self).distinct(by: ["tableSize"])
var slices: [DistributionCounter] = []
var othersCount: Int = 0
for tournament in tournaments {
let tableSizeCount = realm.objects(Tournament.self).filter("tableSize == %i", tournament.tableSize).count
if (tableSizeCount < 5) {
othersCount += tableSizeCount
} else {
let counter = DistributionCounter(name: TableSize.format(tableSize: tournament.tableSize), counter: tableSizeCount)
slices.append(counter)
}
}
let others = DistributionCounter(name: "Others", counter: othersCount)
slices.append(others)
slices.sort { (d1, d2) -> Bool in
return d1.counter > d2.counter
}
return slices
}
static func rankingCounts(realm: Realm) -> [PlayerNotableFinishes] { static func rankingCounts(realm: Realm) -> [PlayerNotableFinishes] {
let players: Results<Player> = realm.objects(Player.self) let players: Results<Player> = realm.objects(Player.self)

@ -68,6 +68,7 @@ class ReportGenerator {
var gamesDistribution: [DistributionCounter] = [] var gamesDistribution: [DistributionCounter] = []
var rankings1: PlayerNotableFinishesDataSource = PlayerNotableFinishesDataSource(notableFinishes: []) var rankings1: PlayerNotableFinishesDataSource = PlayerNotableFinishesDataSource(notableFinishes: [])
var finalTables: [CumulatedResults] = [] var finalTables: [CumulatedResults] = []
var tableSizeDistribution: [DistributionCounter] = []
func generateReports() { func generateReports() {
@ -97,6 +98,8 @@ class ReportGenerator {
self.rankings1 = pnds self.rankings1 = pnds
self.finalTables = pnds.finalTablesCumulated() self.finalTables = pnds.finalTablesCumulated()
self.tableSizeDistribution = Queries.tableSizeDistribution(realm: realm)
let tourniesDate = realm.objects(Tournament.self).distinct(by: ["date"]) let tourniesDate = realm.objects(Tournament.self).distinct(by: ["date"])
// Individual days // Individual days

@ -38,7 +38,7 @@ class FestivalStats : NSObject, UICollectionViewDataSource, UICollectionViewDele
name = "Total Entries".uppercased() name = "Total Entries".uppercased()
value = self.totalEntries.formatted value = self.totalEntries.formatted
case 3: case 3:
name = "Cumulated Buy-ins".uppercased() name = "Cost of entering all tournaments".uppercased()
value = self.cumulatedBuyins.currencyFormatted value = self.cumulatedBuyins.currencyFormatted
default: default:
name = "" name = ""

@ -48,7 +48,7 @@ class PlayerNotableFinishesDataSource : NSObject, UITableViewDataSource, UITable
self.mostWins = nWins.filter { $0.wins.count == winsTopCount} self.mostWins = nWins.filter { $0.wins.count == winsTopCount}
for win in self.mostWins { for win in self.mostWins {
self.winsDisplay.append((win.player.formattedName, Fonts.cellTitle)) self.winsDisplay.append((win.player.formattedName, Fonts.bold))
let sortedWins = win.wins.sorted(by: { $0.tournaments.first!.number < $1.tournaments.first!.number }) let sortedWins = win.wins.sorted(by: { $0.tournaments.first!.number < $1.tournaments.first!.number })
for result in sortedWins { for result in sortedWins {
if let tournamentName = result.tournaments.first?.formatted { if let tournamentName = result.tournaments.first?.formatted {
@ -68,7 +68,7 @@ class PlayerNotableFinishesDataSource : NSObject, UITableViewDataSource, UITable
self.mostRunnerUps = nRunnerups.filter { $0.runnerUps.count == runnerUpsTopCount } self.mostRunnerUps = nRunnerups.filter { $0.runnerUps.count == runnerUpsTopCount }
for runnerup in self.mostRunnerUps { for runnerup in self.mostRunnerUps {
self.runnerUpsDisplay.append((runnerup.player.formattedName, Fonts.cellTitle)) self.runnerUpsDisplay.append((runnerup.player.formattedName, Fonts.bold))
let sortedRunnerUps = runnerup.runnerUps.sorted(by: { $0.tournaments.first!.number < $1.tournaments.first!.number }) let sortedRunnerUps = runnerup.runnerUps.sorted(by: { $0.tournaments.first!.number < $1.tournaments.first!.number })
for result in sortedRunnerUps { for result in sortedRunnerUps {
if let tournamentName = result.tournaments.first?.formatted { if let tournamentName = result.tournaments.first?.formatted {
@ -159,6 +159,10 @@ class PlayerNotableFinishesDataSource : NSObject, UITableViewDataSource, UITable
return self.headerLabel(text: text) return self.headerLabel(text: text)
} }
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 36.0
}
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat { func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
return 60.0 return 60.0
} }

@ -18,6 +18,11 @@ class DistributionCounter : HTMLRepresentable {
self.name = name self.name = name
} }
convenience init(name: String, counter: Int) {
self.init(name: name)
self.counter = counter
}
func increment() { func increment() {
self.counter += 1 self.counter += 1
} }

@ -163,7 +163,7 @@ class TournamentStats : NSObject, HTMLRepresentable, UITableViewDelegate, UITabl
} }
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
return CGSize(width: 380.0, height: 90.0) return CGSize(width: 650.0, height: 90.0)
} }
} }

@ -0,0 +1,22 @@
//
// TableSize.swift
// TournamentStats
//
// Created by Laurent Morvillier on 30/08/2019.
// Copyright © 2019 Stax River. All rights reserved.
//
import Foundation
class TableSize {
static func format(tableSize: Int) -> String {
switch tableSize {
case 2:
return "Heads-up"
default:
return "\(tableSize)-max"
}
}
}
Loading…
Cancel
Save