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 SwiftUI | |
import CoreData | |
struct AddBetView: View { | |
@Environment(\.managedObjectContext) var moc | |
@Environment(\.presentationMode) var presentationMode | |
@EnvironmentObject var betViewModel: BetViewModel | |
@AppStorage("savehometeam") var homeTeamData: String = "Home Team" | |
@AppStorage("saveawayteam") var awayTeamData: String = "Away Team" | |
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
struct DuoLingoFireworks: View { | |
var body: some View { | |
ZStack { | |
FireWork() | |
} | |
} | |
} | |
#Preview { |
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 SwiftUI | |
import Foundation | |
struct MasonryLayoutRows: View { | |
@State private var rows = 3 | |
@State private var views = (0..<20).map { _ in | |
CGSize(width: .random(in: 10...500), height: .random(in: 10...500))} | |
var body: some View { | |
ScrollView(.horizontal) { | |
LazyHStack { |
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" |
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 SwiftUI | |
struct EditBetView: View { | |
@Binding var bet: BetModel | |
@Environment(\.presentationMode) var presentationMode | |
@EnvironmentObject var betViewModel: BetViewModel | |
@AppStorage("savehometeam") var homeTeamData: String = "Home Team" | |
@AppStorage("saveawayteam") var awayTeamData: String = "Away Team" | |
@State var chooseLeague: Leagues = .chooseleague |
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 SwiftUI | |
struct AddBetView: View { | |
@Environment(\.presentationMode) var presentationMode | |
@EnvironmentObject var betViewModel: BetViewModel | |
@AppStorage("savehometeam") var homeTeamData: String = "Home Team" | |
@AppStorage("saveawayteam") var awayTeamData: String = "Away Team" | |
@State var chooseLeague: Leagues = .chooseleague | |
@State var homeTeam: String = "" |
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 SwiftUI | |
struct BetDetailsView: View { | |
var bet: BetModel | |
@ObservedObject var betViewModel: BetViewModel | |
// States for the button animations | |
@State var scaleWinButton: CGFloat = 1.0 | |
@State var scaleLooseButton: CGFloat = 1.0 | |
@State var scalePushButton: CGFloat = 1.0 |
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 SwiftUI | |
struct AddBetView: View { | |
@Environment(\.presentationMode) var presentationMode | |
@EnvironmentObject var betViewModel: BetViewModel | |
@AppStorage("savehometeam") var homeTeamData: String = "Home Team" | |
@AppStorage("saveawayteam") var awayTeamData: String = "Away Team" | |
@AppStorage("Rikard") var startNewBettorArray: String = "" | |
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 | |
struct BetModel: Identifiable, Codable { // Identifiable so we have id on each item and codable so it can handle JSON data | |
let id: String | |
var league: String | |
let homeTeam: String | |
let awayTeam: String | |
var dateForBet: Date | |
let typeOfBet: String |
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 | |
struct BetDataPoint: Identifiable { | |
var id = UUID() | |
let date: Date | |
let total: Double | |
let league: String | |
} |
NewerOlder