I want the images to fill the screen I tried using frame also but it didn't work?Basically the images aren't even filling the the list I want it to fill the list I can use ignoresSafeArea after that

struct ContentView: View {

var movies:[MovieData] = [MovieData(movieName: "Captain America", movieImage: "captainamerica"),MovieData(movieName: "Dune", movieImage: "dune"),MovieData(movieName: "Home Alone", movieImage: "homealone"),MovieData(movieName: "Mario Bros.", movieImage: "mariobros"),MovieData(movieName: "Mission Impossible", movieImage: "missionimpossible")]


var body: some View {
    VStack {
        
        
        
        List(movies){movie in
            
            VStack{
                Image(movie.movieImage)
                    .resizable()
                    .aspectRatio(contentMode: .fit
                    )
                
                Text(movie.movieName)
                    .fontWeight(.light)
                
                
                
            }
        }.frame(maxWidth:.infinity,maxHeight: .infinity)

        
        
        
        
    }
    .padding()
}

}

I got it I had to remove the padding from VStack

Ok I solved the 1st part Now I want to add modifiers to only the first element of the list how do I do that.

Do you mean that you want the first entry in the list to look different than the rest? That seems to be counter intuitive so why you would want to do that?

You can do that kind of thing but like I say, it seems counter intuitive to me. For the purposes of the exercise this is an option:

struct ContentView: View {
    var movies:[MovieData] = [
        MovieData(movieName: "Captain America", movieImage: "captainamerica"),
        MovieData(movieName: "Dune", movieImage: "dune"),
        MovieData(movieName: "Home Alone", movieImage: "homealone"),
        MovieData(movieName: "Mario Bros.", movieImage: "mariobros"),
        MovieData(movieName: "Mission Impossible", movieImage: "missionimpossible")
    ]
    var body: some View {
        VStack {
            List(movies.indices, id: \.self) { movieIndex in

                VStack {
                    Image(movies[movieIndex].movieImage)
                        .resizable()
                        .aspectRatio(contentMode: .fill)
                        .cornerRadius(20)
                        .overlay(
                            RoundedRectangle(cornerRadius: 20)
                                .stroke(movieIndex == 0 ? Color.red : Color.clear, lineWidth: 3)
                            )
                    Text(movies[movieIndex].movieName)
                        .fontWeight(.light)
                        .padding(.bottom)
                }
                .listRowSeparator(.hidden)
            }
            .listStyle(.plain)
        }
    }
}

By telling the List to do this:
List(movies.indices, id: \.self) { movieIndex in
what that does is give you an Index value to work with inside the list. That gives you a means of detecting which array index to identify to treat it differently. In the example above I have applied a visible border to it using the .overlay modifier so that it matches the cornerRadius but only applies that where the index value is 0 (ie, the first in the list).

You could take this to the next level by using an onTapGesture to tap the image and set the border to the selected image.

Example:

struct ContentView: View {
    var movies:[MovieData] = [
        MovieData(movieName: "Captain America", movieImage: "captainamerica"),
        MovieData(movieName: "Dune", movieImage: "dune"),
        MovieData(movieName: "Home Alone", movieImage: "homealone"),
        MovieData(movieName: "Mario Bros.", movieImage: "mariobros"),
        MovieData(movieName: "Mission Impossible", movieImage: "missionimpossible")
    ]
    @State private var selectedIndex = 0

    var body: some View {
        VStack {
            List(movies.indices, id: \.self) { movieIndex in

                VStack {
                    Image(movies[movieIndex].movieImage)
                        .resizable()
                        .aspectRatio(contentMode: .fill)
                        .cornerRadius(20)
                        .overlay(
                            RoundedRectangle(cornerRadius: 20)
                                .stroke(movieIndex == selectedIndex ? Color.red : Color.clear, lineWidth: 3)
                            )
                        .onTapGesture {
                            selectedIndex = movieIndex
                        }
                    Text(movies[movieIndex].movieName)
                        .fontWeight(.light)
                        .padding(.bottom)
                }
                .listRowSeparator(.hidden)
            }
            .listStyle(.plain)
        }
    }
}

By the way, this works better if you have your device in dark mode.

Thanks Chris,
Also where can I learn core motion and SceneKit.Im applying to college to get into a physics program and I need a solid physics and app collaboration project.Note : I want to build something useful not an educational app.I want to build something applied which researchers can actually use even if its basic its fine and no calculators im bored of building calculators.

Chris Ching has not delved into Games so the best person to follow for that is Paul Hudson.

His web site is www.hackingwithswift.com

If you follow his “100 Days of Swift” course (covering UIKit) he gets into SpriteKit, GameplayKit and how physics is an integral part of that. I was never a Games person but the games in that were a heap of fun. Well worth following if you have the time and the patience.

What about getting data from sensors and using coremotion.

CoreMotion is used in the MarbleMaze App build which is Project 26 in the course. That takes information from the accelerometer.

where can I find that lecture can you send me the link

It’s part of the “100 Days of Swift” course I described in my earlier post. This is the link to the course:

https://www.hackingwithswift.com/100

There is an index on the opening page of the course so scroll down that page and you will find that project.