struct SuccessView: View {
@ObservedObject var viewModel: UserViewModel
@State private var searchText = ""
var results: [User] {
searchText.isEmpty ? viewModel.users : viewModel.users.filter {$0.name.contains(searchText)}
}
var body: some View {
List {
ForEach(results) { user in
NavigationLink {
UserDetailView(user: user)
} label: {
UserRowView(user: user)
} //: NavigationLink
} //: ForEach
} //: List
.searchable(text: $searchText)
}
}
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)