Created
October 27, 2023 17:27
-
-
Save allfinlir/2a172edebe8264b2e448aab4944cb79a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import SwiftUI | |
enum Leagues: String, CaseIterable { | |
case chooseleague = "Choose League" | |
case laLiga = "LaLiga" | |
case premierLeague = "Premier League" | |
case bundesliga = "Bundesliga" | |
case serieA = "Serie A" | |
case ligue1 = "Ligue 1" | |
var localName: LocalizedStringKey { LocalizedStringKey(rawValue)} | |
} | |
func selectLeague(league: Leagues) -> [String] { | |
switch league { | |
case .chooseleague: | |
return ["Select Team"] | |
case .laLiga: | |
return ["Select Team", "Almeria", "Ath. Bilbao", "Atletico Madrid", "Cadiz CF", "Celta Vigo", "Elche", "Espanyol", "FC Barcelona", "Getafe", "Girona", "Mallorca", "Osasuna", "Real Betis", "Real Madrid", "Real Sociedad", "Sevilla", "Valencia", "Valladolid", "Vallencano", "Villarreal"] | |
case .premierLeague: | |
return ["Select Team", "Arsenal", "Aston Villa", "Bournemouth", "Brentford", "Brighton", "Chelsea", "Crystal Palace", "Everton", "Fulham", "Leeds", "Leicester", "Liverpool", "Man City", "Man United", "Newcastle", "Nottingham Forest", "Southhampton", "Tottenham", "West ham", "Wolverhampton"] | |
case .bundesliga: | |
return ["Select Team", "Augsburg", "B.Mönchengladbach", "Bayern Munchen", "Bochum", "Dortmund", "Eintracht Frankfurt", "FC Köln", "Freiburg", "Hertha Berlin", "Hoffenheim", "Leverkusen", "Mainz", "RB Leipzig", "Schalke 04", "Stuttgart", "Union Berlin", "Werder Bremen", "Wolfsburg"] | |
case .serieA: | |
return ["Select Team", "Atalanta", "Bologna", "Cremonese", "Empoli", "Fiorentina", "Inter", "Juventus", "Lazio", "Lecce", "Milan", "Monza", "Napoli", "Roma", "Salernitana", "Sampdoria", "Sassuolo", "Spezia", "Torino", "Udinese", "Verona"] | |
case .ligue1: | |
return ["Select Team", "AC Ajaccio", "Angers", "Auxerre", "Brest", "Clermont", "Lens", "Lille", "Lorient", "Lyon", "Marseille", "Monaco", "Montpellier", "Nantes", "Nice", "PSG", "Reims", "Rennes", "Strasbourg", "Toulouse", "Troyes"] | |
} | |
} | |
func selectedLeagueForCountryFlag(country: Leagues) -> String { | |
switch country { | |
case .chooseleague: | |
return "" | |
case .laLiga: | |
return "spain" | |
case .premierLeague: | |
return "england" | |
case .bundesliga: | |
return "germany" | |
case .serieA: | |
return "italy" | |
case .ligue1: | |
return "france" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment