title: For-in loop requires '[UserVehicles]?' to conform to 'Sequence'; did you mean to unwrap optional? Swift
body: <p>I have a data model which I made for API returns, it is something like this:</p>
  <pre><code>struct VehicleData: Codable {
      
      let _embedded: Embedded
      
   }
  
  struct Embedded: Codable {
      let userVehicles: [UserVehicles]
  }
  
  
  struct UserVehicles: Codable {
      let id: String
      let images: [String]
      let userId: String
      let vehicle: Vehicle
      let originalPrice: OriginalPrice
      let hasBasicInsurance: Bool
  
  }
  
  </code></pre>
  <p>I have used callback function to pass it to my ViewController, now I want to get check in the useVehiclers list, how many vehicles hasBasicInsurance. basically, <code>vehicleList?._embedded.userVehicles[i] = true</code></p>
  <p>this is my function code to use the vehicle data in ViewController:</p>
  <pre><code>    var vehicleManager = VehicleManager()
      var vehicleList: VehicleData?
      var i: Int = 0
      
      @IBOutlet weak var tableView: UITableView!
         
      override func viewDidLoad() {
          super.viewDidLoad()
          
          vehicleManager.retrieveUserVehicle()
          vehicleManager.onDataUpdate = { [weak self] (data: VehicleData) in
              self?.useData(data: data)
          }
          
          tableView.dataSource = self
          tableView.delegate = self
          tableView.tableFooterView = UIView() //remove empty tableView cells
          tableView.register(UINib(nibName: Constants.vehicleListCellNibName, bundle: nil), forCellReuseIdentifier: Constants.vehicleListToBeInsuredIdentifier)
          
      }
      
      func useData(data: VehicleData) {
          vehicleList = data
          
  // code below has issues.... 
  for i in [vehicleList?._embedded.userVehicles] {
              
              if let vechile = vehicleList?._embedded.userVehicles[i].hasBasicInsurance {
                  if vehicle == true {
                      i = i + 1
                      print(&quot;&gt;&gt;number of of insured vehidle: \(i)&quot;)
                  } else {
                      print(&quot;&gt;&gt;&gt;number of of insured vehidle: \(i)&quot;)
                  }
              }
              
              
              
          }
          
      }
  
  </code></pre>
  <p><a href="https://i.stack.imgur.com/8K4c0.png" rel="noreferrer"><img src="https://i.stack.imgur.com/8K4c0.png" alt="enter image description here" /></a></p>
  <p>Do you know how to fix it?</p>