I just started to work on the Lesson 13 challenge, and I got everything to display but I don’t know how to shuffle the objects and update the stats based on those changes. Any advice?
//
// ContentView.swift
// Shared
//
// Created by Eric Beecroft on 10/3/21.
//
import SwiftUI
struct ContentView: View {
@State var credits = 1000;
@State var slot1;
@State var slot2;
@State var slot3;
func slotMachine()
{
//Switch the apples around
}
var body: some View {
VStack{
VStack{
Spacer()
Text("SwiftUI Slots!")
Spacer()
}
VStack{
Spacer()
Text("Credits: " + String(credits))
Spacer()
}
HStack{
Spacer()
Image("apple")
Spacer()
Image("apple")
Spacer()
Image("apple")
Spacer()
}
VStack{
Spacer()
Text("button")
Spacer()
}
}
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}