Mercurial > public > lazybear
view lazybear/Supply views/CompanyList.swift @ 81:12a0776e6d9a
Implement new core data
author | Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com> |
---|---|
date | Mon, 25 Jan 2021 12:07:09 +0100 |
parents | 7fef171d4820 |
children | 0730f031e478 |
line wrap: on
line source
// // CompanyList.swift // LazyBear // // Created by Dennis Concepción Martín on 15/1/21. // import SwiftUI struct CompanyList: View { @Binding var searchedCompany: String var body: some View { List { ForEach(companiesData.filter({ searchedCompany.isEmpty ? true : $0.name.localizedStandardContains(searchedCompany) }) , id: \.symbol) { company in //CompanyRow(company: company) } } .edgesIgnoringSafeArea(.bottom) .cornerRadius(20) .id(UUID()) // Increase speed in search the list } } struct CompanyList_Previews: PreviewProvider { static var previews: some View { CompanyList(searchedCompany: .constant("Apple")) } }