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]()))
}
}