My Xcode, Isn't responding, even after restart

May you please tell, why the rectangle is not appearing on my screen,

//
//  ContentView.swift
//  Learning App
//
//  Created by Sam Grover on 29/06/22.
//

import SwiftUI

struct HomeView: View {
    @EnvironmentObject var model: ContentModel
    var body: some View {
        ScrollView{
            LazyVStack{
                ForEach(model.modules){
                    module in
                    
                    ZStack{
                        Rectangle().foregroundColor(.black)
                    }
                }
            }
        }
    }
}

struct HomeView_Previews: PreviewProvider {
    static var previews: some View {
        HomeView().environmentObject(ContentModel())
    }
}
![Screenshot 2022-06-30 at 9.57.01 PM|690x420](upload://uFG4QHM3P25hl9pOX84i8Wz1NxA.jpeg)

@Sam_Grover

Which course is this related to?

Module 5 Lesson 4 of 90 day Challenge

OK so the App you are currently building is the LearningApp.

The screenshot link you pasted into the initial post did not render as an image because the link was pasted inside the “formatted text”. If you still have that image can you add that in a reply so I can see what you are seeing. If I paste the code above into my version of the LearningApp I see this:

which is probably right given that there is no other code to display any other details.

@Sam_Grover

What happens if you run it on a simulator rather than observing what is happening in the Preview?

I got to know about the problem sir, I didn’t wrote module (model) properly, therefore, it was showing nothing, firstly, I continued coding on the Chris Project, which I downloaded form M5L3 LearningApp.zip https://www.dropbox.com/sh/gc91epvtjdwks19/AAA3I93aGEmduDBD3g2eLZjea/Module%205/Lesson%2003?dl=0&preview=M5L3+LearningApp.zip&subfolder_nav_tracking=1

then I got to know about the problem, BTW, thanks for Help :innocent: :innocent: :innocent:

1 Like

Great to hear that you are back on track.