Skip to content

Commit

Permalink
feat: 2024 brackets (#6)
Browse files Browse the repository at this point in the history
* feat: Make round stepper more dynamic

* feat: Improved initial bracket selection view

* feat: Improved single game team selection

* feat: Improve menu view spacing on small screens

* feat: Add 14 new Division 1 teams

* feat: Lengthen some team names

* feat: Update probabilities post-2023 tourney

* fix: Minor view improvements

* feat: 2024 brackets

* chore: Update version to 1.9
  • Loading branch information
mvirgo authored Mar 18, 2024
1 parent 60fc505 commit 1a372b3
Show file tree
Hide file tree
Showing 22 changed files with 1,149 additions and 394 deletions.
12 changes: 6 additions & 6 deletions foam-madness-tests/foam_madness_bracket_file_tests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
//

import XCTest
@testable import foam_madness

final class foam_madness_bracket_file_tests: XCTestCase {
let bracketIndexFile = "bracketIndex"

var brackets: [Dictionary<String, String>] = []
var brackets: [BracketItem] = []
var currentBracketName: String = ""
var hasFirstFour = false
var regions = [String: [String: Int16]]()
Expand All @@ -24,13 +25,12 @@ final class foam_madness_bracket_file_tests: XCTestCase {

func loadBrackets() {
// Load the bracket index
let path = Bundle.main.path(forResource: bracketIndexFile, ofType: "plist")!
brackets = NSArray(contentsOfFile: path) as! [Dictionary<String, String>]
brackets = BracketHelper.loadBrackets()
}

func loadSingleBracket(bracket: Dictionary<String, String>) {
currentBracketName = bracket.first!.value;
let bracketLocation = bracket.first!.key;
func loadSingleBracket(bracket: BracketItem) {
currentBracketName = bracket.name
let bracketLocation = bracket.file
// Load the given bracket
let bracketPath = Bundle.main.path(forResource: bracketLocation, ofType: "plist")!
let bracketDict = NSDictionary(contentsOfFile: bracketPath)!
Expand Down
40 changes: 20 additions & 20 deletions foam-madness.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
7A2ECEF3242EDE930065E369 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 7A2ECEF1242EDE930065E369 /* LaunchScreen.storyboard */; };
7A494BC3243041C20042173A /* foam-madness.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 7A494BC1243041C20042173A /* foam-madness.xcdatamodeld */; };
7A494BC5243046A50042173A /* DataController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A494BC4243046A50042173A /* DataController.swift */; };
7A771E5B250D9BDD009FE9EA /* LiveGameCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A771E5A250D9BDD009FE9EA /* LiveGameCollectionViewCell.swift */; };
7A771E5D250DA571009FE9EA /* LiveGameCollectionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A771E5C250DA571009FE9EA /* LiveGameCollectionViewController.swift */; };
7A916BD825EDE5D5007E8714 /* womensBracket2021.plist in Resources */ = {isa = PBXBuildFile; fileRef = 7A916BD625EDE5D4007E8714 /* womensBracket2021.plist */; };
7A916BD925EDE5D5007E8714 /* mensBracket2021.plist in Resources */ = {isa = PBXBuildFile; fileRef = 7A916BD725EDE5D4007E8714 /* mensBracket2021.plist */; };
7ACBCB37250EC73900EBA5B1 /* APIClient.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7ACBCB36250EC73900EBA5B1 /* APIClient.swift */; };
Expand All @@ -29,6 +27,8 @@
7AECF9C8245E779E0037E126 /* womensBracketology2020.plist in Resources */ = {isa = PBXBuildFile; fileRef = 7AECF9C7245E779E0037E126 /* womensBracketology2020.plist */; };
7AEFD6672514704E007BB16B /* ABOUT.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 7AEFD6662514704E007BB16B /* ABOUT.rtf */; };
7AF31A862431267400DF1605 /* GameHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AF31A852431267400DF1605 /* GameHelper.swift */; };
D11E4F8F2BA7410100CA9FDD /* womensBracket2024.plist in Resources */ = {isa = PBXBuildFile; fileRef = D11E4F8D2BA7410100CA9FDD /* womensBracket2024.plist */; };
D11E4F902BA7410100CA9FDD /* mensBracket2024.plist in Resources */ = {isa = PBXBuildFile; fileRef = D11E4F8E2BA7410100CA9FDD /* mensBracket2024.plist */; };
D1386BDE2B929752006C676C /* NavigationUtil.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1386BDD2B929752006C676C /* NavigationUtil.swift */; };
D14720182B60D22500453304 /* PreviewDataController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D14720172B60D22500453304 /* PreviewDataController.swift */; };
D147201A2B60D6FC00453304 /* TeamHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = D14720192B60D6FC00453304 /* TeamHelper.swift */; };
Expand All @@ -50,6 +50,8 @@
D15865922B5751CE009E486A /* TournamentStatsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D15865912B5751CE009E486A /* TournamentStatsView.swift */; };
D15865952B575ECE009E486A /* PrimaryButtonStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = D15865942B575ECE009E486A /* PrimaryButtonStyle.swift */; };
D158B32D2B9A96720002D2F6 /* GameStatsController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D158B32C2B9A96720002D2F6 /* GameStatsController.swift */; };
D17FF6012BA140DA00149D63 /* SearchTeamView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D17FF6002BA140DA00149D63 /* SearchTeamView.swift */; };
D17FF6052BA1454900149D63 /* SearchBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = D17FF6042BA1454900149D63 /* SearchBar.swift */; };
D18D756E29BEA5AC00DE609B /* mensBracket2023.plist in Resources */ = {isa = PBXBuildFile; fileRef = D18D756D29BEA5AC00DE609B /* mensBracket2023.plist */; };
D18D757029BEA5B500DE609B /* womensBracket2023.plist in Resources */ = {isa = PBXBuildFile; fileRef = D18D756F29BEA5B500DE609B /* womensBracket2023.plist */; };
D199087B2B996D6200A57746 /* ShootModeController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D199087A2B996D6200A57746 /* ShootModeController.swift */; };
Expand Down Expand Up @@ -98,8 +100,6 @@
7A494BC2243041C20042173A /* foam-madness.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "foam-madness.xcdatamodel"; sourceTree = "<group>"; };
7A494BC4243046A50042173A /* DataController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DataController.swift; sourceTree = "<group>"; };
7A73579E243ED4A800691B26 /* foam-madness-v2.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "foam-madness-v2.xcdatamodel"; sourceTree = "<group>"; };
7A771E5A250D9BDD009FE9EA /* LiveGameCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LiveGameCollectionViewCell.swift; sourceTree = "<group>"; };
7A771E5C250DA571009FE9EA /* LiveGameCollectionViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LiveGameCollectionViewController.swift; sourceTree = "<group>"; };
7A916BD625EDE5D4007E8714 /* womensBracket2021.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = womensBracket2021.plist; sourceTree = "<group>"; };
7A916BD725EDE5D4007E8714 /* mensBracket2021.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = mensBracket2021.plist; sourceTree = "<group>"; };
7ABF40392456A55600A18B3F /* foam-madness-v3.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "foam-madness-v3.xcdatamodel"; sourceTree = "<group>"; };
Expand All @@ -112,6 +112,8 @@
7AECF9C7245E779E0037E126 /* womensBracketology2020.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = womensBracketology2020.plist; sourceTree = "<group>"; };
7AEFD6662514704E007BB16B /* ABOUT.rtf */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; path = ABOUT.rtf; sourceTree = "<group>"; };
7AF31A852431267400DF1605 /* GameHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GameHelper.swift; sourceTree = "<group>"; };
D11E4F8D2BA7410100CA9FDD /* womensBracket2024.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = womensBracket2024.plist; sourceTree = "<group>"; };
D11E4F8E2BA7410100CA9FDD /* mensBracket2024.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = mensBracket2024.plist; sourceTree = "<group>"; };
D1386BDD2B929752006C676C /* NavigationUtil.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NavigationUtil.swift; sourceTree = "<group>"; };
D14720172B60D22500453304 /* PreviewDataController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PreviewDataController.swift; sourceTree = "<group>"; };
D14720192B60D6FC00453304 /* TeamHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TeamHelper.swift; sourceTree = "<group>"; };
Expand All @@ -133,6 +135,8 @@
D15865912B5751CE009E486A /* TournamentStatsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TournamentStatsView.swift; sourceTree = "<group>"; };
D15865942B575ECE009E486A /* PrimaryButtonStyle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PrimaryButtonStyle.swift; sourceTree = "<group>"; };
D158B32C2B9A96720002D2F6 /* GameStatsController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GameStatsController.swift; sourceTree = "<group>"; };
D17FF6002BA140DA00149D63 /* SearchTeamView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchTeamView.swift; sourceTree = "<group>"; };
D17FF6042BA1454900149D63 /* SearchBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchBar.swift; sourceTree = "<group>"; };
D18D756D29BEA5AC00DE609B /* mensBracket2023.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = mensBracket2023.plist; sourceTree = "<group>"; };
D18D756F29BEA5B500DE609B /* womensBracket2023.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = womensBracket2023.plist; sourceTree = "<group>"; };
D199087A2B996D6200A57746 /* ShootModeController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShootModeController.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -259,22 +263,12 @@
D199087A2B996D6200A57746 /* ShootModeController.swift */,
D1C757A02B9A62C500817E1A /* TournamentStatsController.swift */,
D158B32C2B9A96720002D2F6 /* GameStatsController.swift */,
7A771E59250D9B81009FE9EA /* Live Games */,
7A2ECEE8242EDE920065E369 /* AppDelegate.swift */,
7A2D2E3C262E78A000AB5935 /* Helpers */,
);
path = Controller;
sourceTree = "<group>";
};
7A771E59250D9B81009FE9EA /* Live Games */ = {
isa = PBXGroup;
children = (
7A771E5A250D9BDD009FE9EA /* LiveGameCollectionViewCell.swift */,
7A771E5C250DA571009FE9EA /* LiveGameCollectionViewController.swift */,
);
path = "Live Games";
sourceTree = "<group>";
};
7ACBCB35250EC71400EBA5B1 /* Live Games API */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -305,6 +299,7 @@
7A916BD725EDE5D4007E8714 /* mensBracket2021.plist */,
D14C59E827DED2FE001378F1 /* mensBracket2022.plist */,
D18D756D29BEA5AC00DE609B /* mensBracket2023.plist */,
D11E4F8E2BA7410100CA9FDD /* mensBracket2024.plist */,
D1E16E16283354B0007280EC /* womensBracket2015.plist */,
D1E16E1B283354B0007280EC /* womensBracket2016.plist */,
D1E16E15283354B0007280EC /* womensBracket2017.plist */,
Expand All @@ -314,6 +309,7 @@
7A916BD625EDE5D4007E8714 /* womensBracket2021.plist */,
D14C59EA27DED30F001378F1 /* womensBracket2022.plist */,
D18D756F29BEA5B500DE609B /* womensBracket2023.plist */,
D11E4F8D2BA7410100CA9FDD /* womensBracket2024.plist */,
D1E16E1028334BB0007280EC /* bracketIndex.plist */,
);
path = brackets;
Expand Down Expand Up @@ -341,6 +337,8 @@
isa = PBXGroup;
children = (
D158657B2B574FB9009E486A /* SelectTeamsView.swift */,
D17FF6002BA140DA00149D63 /* SearchTeamView.swift */,
D17FF6042BA1454900149D63 /* SearchBar.swift */,
);
path = Team;
sourceTree = "<group>";
Expand Down Expand Up @@ -490,6 +488,7 @@
D1E16E1128334BB0007280EC /* bracketIndex.plist in Resources */,
7AEAB80B2433086C009E7CC1 /* teams.plist in Resources */,
7AECF9C8245E779E0037E126 /* womensBracketology2020.plist in Resources */,
D11E4F8F2BA7410100CA9FDD /* womensBracket2024.plist in Resources */,
7A2ECEF3242EDE930065E369 /* LaunchScreen.storyboard in Resources */,
D1E16E22283354B0007280EC /* mensBracket2015.plist in Resources */,
D1E16E21283354B0007280EC /* womensBracket2018.plist in Resources */,
Expand All @@ -507,6 +506,7 @@
D14C59E927DED2FE001378F1 /* mensBracket2022.plist in Resources */,
D1E16E1F283354B0007280EC /* womensBracket2017.plist in Resources */,
7AEFD6672514704E007BB16B /* ABOUT.rtf in Resources */,
D11E4F902BA7410100CA9FDD /* mensBracket2024.plist in Resources */,
D1E16E24283354B0007280EC /* mensBracket2018.plist in Resources */,
7A1B9C9D245A9A22005B40D3 /* historicalProbabilitiesWomen.plist in Resources */,
7A916BD825EDE5D5007E8714 /* womensBracket2021.plist in Resources */,
Expand Down Expand Up @@ -538,12 +538,12 @@
D199087B2B996D6200A57746 /* ShootModeController.swift in Sources */,
D1C757A12B9A62C500817E1A /* TournamentStatsController.swift in Sources */,
D15865802B5750F9009E486A /* ShootModeView.swift in Sources */,
D17FF6012BA140DA00149D63 /* SearchTeamView.swift in Sources */,
D158657A2B574F94009E486A /* LiveGamesCell.swift in Sources */,
7ACBCB3B250EC7FC00EBA5B1 /* ErrorResponse.swift in Sources */,
D15865882B575176009E486A /* SelectInitialBracketView.swift in Sources */,
D158B32D2B9A96720002D2F6 /* GameStatsController.swift in Sources */,
7ACBCB37250EC73900EBA5B1 /* APIClient.swift in Sources */,
7A771E5D250DA571009FE9EA /* LiveGameCollectionViewController.swift in Sources */,
D15865732B574D4D009E486A /* MenuView.swift in Sources */,
D1A8B1A02B9FF03100354C9F /* TournamentGameCell.swift in Sources */,
D15865902B5751BE009E486A /* SelectTournamentView.swift in Sources */,
Expand All @@ -556,14 +556,14 @@
D147201A2B60D6FC00453304 /* TeamHelper.swift in Sources */,
D199087D2B99703500A57746 /* SaveHelper.swift in Sources */,
D1D4F9C32B97E4D0004B9C18 /* BracketCreationController.swift in Sources */,
7A771E5B250D9BDD009FE9EA /* LiveGameCollectionViewCell.swift in Sources */,
D158657E2B5750E7009E486A /* PlayGameView.swift in Sources */,
7AF31A862431267400DF1605 /* GameHelper.swift in Sources */,
D15865842B575118009E486A /* GameStatsView.swift in Sources */,
D1386BDE2B929752006C676C /* NavigationUtil.swift in Sources */,
D15865952B575ECE009E486A /* PrimaryButtonStyle.swift in Sources */,
7A2ECEE9242EDE920065E369 /* AppDelegate.swift in Sources */,
D158658C2B575197009E486A /* TournamentGamesView.swift in Sources */,
D17FF6052BA1454900149D63 /* SearchBar.swift in Sources */,
7A2D2E3F262E7FBE00AB5935 /* SimHelper.swift in Sources */,
D15865822B57510D009E486A /* GameScoreView.swift in Sources */,
);
Expand Down Expand Up @@ -728,15 +728,15 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 12;
CURRENT_PROJECT_VERSION = 13;
DEVELOPMENT_TEAM = 5X3GA242G5;
INFOPLIST_FILE = "foam-madness/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.8;
MARKETING_VERSION = 1.9;
PRODUCT_BUNDLE_IDENTIFIER = "com.mvirgo.foam-madness";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand All @@ -749,15 +749,15 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 12;
CURRENT_PROJECT_VERSION = 13;
DEVELOPMENT_TEAM = 5X3GA242G5;
INFOPLIST_FILE = "foam-madness/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.8;
MARKETING_VERSION = 1.9;
PRODUCT_BUNDLE_IDENTIFIER = "com.mvirgo.foam-madness";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand Down
33 changes: 31 additions & 2 deletions foam-madness/Controller/Helpers/BracketHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,38 @@

import Foundation

struct BracketItem {
let file: String
let name: String
let isWomens: Bool
let year: Int

init?(dictionary: [String: Any]) {
guard let file = dictionary["File"] as? String,
let name = dictionary["Name"] as? String,
let isWomens = dictionary["IsWomens"] as? Bool,
let year = dictionary["Year"] as? Int else {
return nil
}
self.file = file
self.name = name
self.isWomens = isWomens
self.year = year
}
}

class BracketHelper {
static func loadBrackets() -> [Dictionary<String, String>] {
static func loadBrackets() -> [BracketItem] {
let path = Bundle.main.path(forResource: "bracketIndex", ofType: "plist")!
return NSArray(contentsOfFile: path) as! [Dictionary<String, String>]
let bracketArray = NSArray(contentsOfFile: path) as! [[String: Any]]

var bracketItems = [BracketItem]()
for dict in bracketArray {
if let bracketItem = BracketItem(dictionary: dict) {
bracketItems.append(bracketItem)
}
}

return bracketItems
}
}
4 changes: 2 additions & 2 deletions foam-madness/Controller/Helpers/GameHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ class GameHelper {
case 0:
out = "First Four"
case 1:
out = "First Round"
out = "Round of 64"
case 2:
out = "Second Round"
out = "Round of 32"
case 3:
out = "Sweet Sixteen"
case 4:
Expand Down

This file was deleted.

Loading

0 comments on commit 1a372b3

Please sign in to comment.