Thanks Fellow Forum Members

Thanks for zero replies. I can't believe that 28 to 51 people looked at my post and no one responded back. Anyway, I figured it out on my own after taking a break. I was just asking in so many words, where do I put the bold highlighted code.

WHY NOT TRY app completed……….

// // ContentView.swift // WhyNotTry // // Created by Geraldine Jones on 1/26/24. //

import SwiftUI

struct ContentView: View { var activities = ["Archery", "Baseball", "Basketball", "Bowling", "Boxing", "Cricket", "Curling", "Fencing", "Golf", "Hiking", "Lacrosse", "Rugby", "Squash"] var colors: [Color] = [.blue, .cyan, .gray, .green, .indigo, .mint, .orange, .pink, .purple, .red]

******** @State private var selected = "Baseball"******** @State private var id = 1

var body: some View {
    VStack {
        Text("Why not try...")
            .font(.largeTitle.bold())
        VStack {
            Circle()
                .fill(colors.randomElement() ?? .blue)
                .padding()
                .overlay(
                    Image(systemName: "figure.\(selected.lowercased())")
                        
                        .font(.system(size: 144))
                        .foregroundColor(.white)
                     ********   .transition(.slide)********
                      ********  .id(id)********
                )
            Text("\(selected)!")
                .font(.title)
        }
        
        Spacer()
        
        Button("Try again") {
           ****** withAnimation(.easeInOut(duration: 1))****** {
                selected = activities.randomElement()
                ?? "Archery"
                ********id += 1********
            }
            
        }
        .buttonStyle(.borderedProminent)
    }
}

}

struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } }

Well, that's a bit passive-aggressive. Maybe those who looked at your post couldn't help? Is that their fault? Maybe it's your fault for not asking a question properly, or not formatting your code properly (exactly like you've just done here)?

Stop being a child. Ask a proper question, and add code within the code formatting block - like most other people seem capable of doing - and maybe people will be able to help.

Works everytime darkpaw, thanks for the feedback.

Thanks Fellow Forum Members
 
 
Q