Error 'Value of type has no subscripts' help pls

I have the next class in the file UserResponse.swift

import Foundation

import UIKit

import SwiftUI

struct UserResponse: Hashable, Codable, Identifiable {

    var id: Int

    var name: String

    var profileImage: String

    var email: String

    var likes: String

    var text: String


And I used it in another file and error appear for this ’ Value of type UserResponse[1] has no subscripts’

struct Cell_Previews: PreviewProvider {

  static var previews: some View {

     Cell(user: UserResponse[1])



Could anyone help pls?!

your UserResponse is not an array. in order to access the data like lets say name. then it needs to be

or if it is an array then it should be UserResponse[0].name