view lazybear/Views/CompanyList.swift @ 131:0299ad98b4de

Rename ApiAccess to ApiManager
author Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com>
date Mon, 08 Feb 2021 18:14:04 +0100
parents 5110adf17b22
children d3468ac3ecc6
line wrap: on
line source

//
//  CompanyList.swift
//  LazyBear
//
//  Created by Dennis Concepción Martín on 7/2/21.
//

import SwiftUI

struct CompanyList: View {
    @State var searchedCompany: String
    
    var body: some View {
        ForEach(companiesData.filter({ searchedCompany.isEmpty ? true : $0.name.localizedStandardContains(searchedCompany) })
                , id: \.symbol) { company in
                CompanyRow(company: company)
            
        }
    }
}

struct CompanyList_Previews: PreviewProvider {
    static var previews: some View {
        //NavigationView {
            CompanyList(searchedCompany: "apple inc")
                .environmentObject(ApiManager())
        //}
    }
}