Issue with image appearing in rectangle Mode. 4 Lesson 4

Hello everyone, I am currently working on the Guidebook app. I 'am following along and when Chris adds the the image on the top part of the ZStack I still have the rectangle without the image. If anyone has any tips or way to fix/help this issue I ddo appreciate it very much.

//
//  CityCard.swift
//  Guidebook
//
//  Created by David Galindo on 8/2/23.
//

import SwiftUI

struct CityCard: View {
    var city : City
    
    var body: some View {
        
        ZStack {
            
            Image(city.imageName)
                .resizable()
                .cornerRadius(15)
            
            Rectangle()
                .foregroundColor(.black)
                .opacity(0.5)
                .cornerRadius(15)
            
            VStack(alignment: .leading) {
                Text(city.name)
                    .font(.largeTitle)
                    .bold()
                    
                
                Spacer()
                
                Text(city.summary)
                
            }
            .foregroundColor(.white)
            .padding()
        }
        .frame(height: 400)
    }
}

struct CityCard_Previews: PreviewProvider {
    static var previews: some View {
        CityCard(city: City(name: "Tokyo", summary: "Tokyo serves as Japan's economic center and is the seat of both the Japanese government and the Emperor of Japan. Tokyo.", imageName: "Tokyo", attractions: [Attraction]()))
    }
}

@DavidGalindo10

Hi David,

Welcome to the community.

Can you post your code for the CityView (or whatever you may have named it) which has the NavigationLink that takes you to the AttractionView and has the label: which is CityCard?

(edit) Ah, I think I know what the issue is. Your asset name for the image for Tokyo should be lowercase in your Preview code where you have provided an instance of city.

Hello Chris,

Yes that was the issue lol. I figured it out, but I didn’t get a notification that you posted a response. Thank you very much !